Skip to main content
Version: Next

isError()

Home > @backstage/errors > isError

Checks whether an unknown value is an ErrorLike object, which guarantees that it's an object that has at least two string properties: a non-empty name and message.

Signature:

function isError(value: unknown): value is ErrorLike;

Parameters

Parameter

Type

Description

value

unknown

an unknown value

**Returns:**

value is ErrorLike

true if the value is an ErrorLike object, false otherwise