core3-utils

@wixc3/common on Github

Home > @wixc3/common > getErrorCode

getErrorCode() function

Returns error.code property if the error object has it, otherwise returns undefined.

Signature:

export declare function getErrorCode(error: Error & {
    code?: string;
}): string | undefined;

Parameters

Parameter Type Description
error Error & { code?: string; }

Returns:

string | undefined