Checks if the given value is an Error.

Syntax

TypeScript
import { isError } from '@opentf/std';

isError(val: unknown): val is Error

Examples

TypeScript
isError(new Error()) //=> true

isError({}) //=> false
Last updated on
Edit this page