Aller au contenu principal

isError

Callable

  • isError(anyValue: unknown): anyValue is Error

  • Check if the provided value is an Error object.

    @example
    isError(new Error('Test Error')); // true
    isError(new TypeError('Test Error')); // true

    isError(undefined); // false
    isError({ name: 'Error' }); // false