Package com.deltawalker.script
Class ScriptCancellationError
java.lang.Object
com.deltawalker.script.ScriptCancellationError
The value an operation rejects with when it is cancelled, for instance
because its comparison was closed while the operation was pending. Scripts
receive it in the
catch block of an await and can tell it
from an ordinary failure by its cancelled property:
try {
await comp.compare();
} catch (e) {
if (e.cancelled) {
console.log('Cancelled: ' + e.message);
} else {
console.error('Error: ' + e);
}
}
Ordinary failures reject with a plain string, for which e.cancelled
is undefined.
- Since:
- 3.0
- See Also:
-
Field Summary
Fields -
Method Summary
-
Field Details
-
cancelled
public final boolean cancelledAlwaystrue. Scripts checke.cancelledto detect cancellation.- See Also:
-
message
Why the operation was cancelled, in plain text.
-
-
Method Details