use ensureError instead. e.g.
ensureError
} catch (e) { const error = ensureError(e); // your error handling logic} Copy
} catch (e) { const error = ensureError(e); // your error handling logic}
Type assertion function that throws a Unhandled MosaicError if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.
Generated using TypeDoc
Deprecated
use
ensureError
instead. e.g.Type assertion function that throws a Unhandled MosaicError if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.