isBettererError()
API > @betterer/errors > isBettererError
Check if an object is a BettererError
.
Signature
export declare function isBettererError(err: unknown): err is BettererError;
Parameters
Parameter | Type | Description |
---|---|---|
err | unknown |
Returns
err is BettererError
Example
import { BettererError, isBettererError } from '@betterer/errors';
isBettererError(new Error()); // false
isBettererError(new BettererError()); // true