Signature
tsSignature
export function fail<E>(error: E): Behavior<unknown, never, E>;Imports
tsImport
import { fail } from "@/lib/flow/fail";import { fail } from "@/lib/flow";Type Parameters
EDomain error type.
Parameters
errorE
Error value returned for every execution.
Returns
A behavior that ignores input and returns `Err`.
Return type
Behavior<unknown, never, E>Details
Use `fail` for fallback branches, tests, and workflow construction where a known typed failure is
the intended result.
Examples
tsExample
const unavailable = fail({ kind: "offline" });Related Symbols
Behavior
Executable Flow workflow unit.
type
Source
tsflow/fail.ts:19-21
export function fail<E>(error: E): Behavior<unknown, never, E> { return task<unknown, never, E>((_input, context) => context.fail(error));}