Ensures that an error is an actual instance of an error.
If it's null or undefined - it is wrapped as UnexpectedNullUndefined
MosaicError. In this case, there might be a bug somewhere that throws null
or undefined.
If it's an instance of an error - passed error is returned as is.
If it's not an instance of an error - it is wrapped as Unhandled
MosaicError. In this case, custom handling of error might be required.
Unlike type assertion, you must use the newly returned value.
Ensures that an error is an actual instance of an error.
Unlike type assertion, you must use the newly returned value.