Const
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.
Deprecated
use
ensureErrorinstead. 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.