Skip to main content

isError

Validates if the supplied input is an Error object.

Signature

isError(input: any): boolean

Parameters

NameTypeOptionalDescription
inputanyNoInput to validate.

Return value

Returns true if the input is an Error object.

Example

import { isError } from "@tripetto/runner";

isError(new Error("Test message")); // Returns `true`