effect-io-ai

Package: effect
Module: Predicate

Predicate.isError

Checks whether a value is an Error.

When to use

Use when you need a Predicate guard for errors caught from unknown sources.

Details

Uses instanceof Error.

Example (Guarding errors)

import { Predicate } from "effect"

const data: unknown = new Error("boom")

console.log(Predicate.isError(data))

See

Signature

declare const isError: (input: unknown) => input is Error

Source

Since v2.0.0