effect-io-ai

Package: effect
Module: SchemaIssue

SchemaIssue.isIssue

Returns true if the given value is an Issue.

When to use

Use when you need to narrow an unknown value to Issue in error-handling code, such as distinguishing an Issue from other error types in a catch-all handler.

Details

Example (Type-guarding an unknown error)

import { SchemaIssue } from "effect"

const issue = new SchemaIssue.MissingKey(undefined)
console.log(SchemaIssue.isIssue(issue))
// true
console.log(SchemaIssue.isIssue("not an issue"))
// false

See

Signature

declare const isIssue: (u: unknown) => u is Issue

Source

Since v4.0.0