Class: ErrorHandler
A class which allows asyncronously thrown errors to be consumed and handled
Methods
off()
ts
off(listener?: (err: Error) => void): ErrorHandler;Unsubscribe an error handler.
Parameters
| Parameter | Type | Description |
|---|---|---|
listener? | (err: Error) => void | The callback to be unsubscribed |
Returns
ErrorHandler
on()
ts
on(listener: (err: Error) => void, ctx?: any): ErrorHandler;Subscribe an error handler.
Parameters
| Parameter | Type | Description |
|---|---|---|
listener | (err: Error) => void | The callback to be called when the error is thrown |
ctx? | any | The this context to be used when calling the callback |
Returns
ErrorHandler
once()
ts
once(listener: (err: Error) => void, ctx?: any): ErrorHandler;Subscribe an error handler for only the next error.
Parameters
| Parameter | Type | Description |
|---|---|---|
listener | (err: Error) => void | The callback to be called when the error is thrown |
ctx? | any | The this context to be used when calling the callback |
Returns
ErrorHandler