Skip to content
1 min read · 72 words

Function: isError()

ts
function isError(value: unknown): value is Error;

Returns true if value is an Error instance or satisfies the Error duck-type shape.

Parameters

ParameterTypeDescription
valueunknownThe value to test.

Returns

value is Error

true when value conforms to the Error shape.

Remarks

Returns false for undefined and null — the Error contract requires an actual instance.