API / geotoolkit / util / Cancel / Cancel
A Cancel is an object that can be used to request cancellation of an operation inside of Promise.
Constructors
Methods
▸ cancel(message?): void
Cancel promise
| Name | Type | Description |
|---|---|---|
Optional message | string | message |
void
▸ getMessage(): string
Return message
string
▸ isCanceled(): boolean
Return true if it was canceled
boolean
▸ setErrorHandler(callback): void
Sets an error handler
| Name | Type | Description |
|---|---|---|
callback | (cancel: Cancel) => void | to be called if cancellation happens |
void
▸ Static isCanceled(error): boolean
Returns true if input parameter is cancel
| Name | Type | Description |
|---|---|---|
error | any | error to check if it is cancellation error |
boolean