core3-utils

@wixc3/common on Github

Home > @wixc3/common > isErrorLikeObject

isErrorLikeObject() function

Checks if the error is an object compatible with the Error interface; that is, it has properties ‘name’ and ‘message’ of type string. The object could be an instance of an Error, or it could be some other kind of object that has these properties.

Signature:

export declare function isErrorLikeObject(error: unknown): error is Error;

Parameters

Parameter Type Description
error unknown

Returns:

error is Error