An error object that can be returned from IPC listeners.
This will automatically be logged as a warning if the listener is not invoked because values can only be returned on invoke.
router.registerListener("example:alwaysError", () => { // do something ... return new Failure("An error has occured.");}) Copy
router.registerListener("example:alwaysError", () => { // do something ... return new Failure("An error has occured.");})
Optional
Static
Call a function and return a Failure if it throws an error.
Rest
Wrap a function in an another function that calls the inner function using Failure.try. This is the same as doing:
const wrapped = (...args) => Failure.try(func, ...args); Copy
const wrapped = (...args) => Failure.try(func, ...args);
An error object that can be returned from IPC listeners.
Remarks
This will automatically be logged as a warning if the listener is not invoked because values can only be returned on invoke.
Example