core3-utils

@wixc3/common on Github

Home > @wixc3/common > toError

toError() function

Convert any kind of value to an error instance. Unless the value is already an error instance, it’s stringified and used as the error message.

Signature:

export declare function toError(value: unknown): Error;

Parameters

Parameter Type Description
value unknown

Returns:

Error