Skip to main content

isBettererError()

API > @betterer/errors > isBettererError

Check if an object is a BettererError.

Signature

export declare function isBettererError(err: unknown): err is BettererError;

Parameters

ParameterTypeDescription
errunknown

Returns

err is BettererError

Example

import { BettererError, isBettererError } from '@betterer/errors';

isBettererError(new Error()); // false
isBettererError(new BettererError()); // true