Overview
functionCore Runtime

isRuntimeError

Narrows an error value to a Flow runtime error.

Signature

tsSignature
export function isRuntimeError(error: unknown): error is RuntimeError;

Imports

tsImport
import { isRuntimeError } from "@/lib/flow/core/runtime";
import { isRuntimeError } from "@/lib/flow";

Parameters

error
unknown

Error value to inspect.

Returns

`true` for `Cancelled` or `Thrown`.

Return type
error is RuntimeError

Details

Recovery helpers use this guard so they only handle expected domain errors.

RuntimeError

Runtime-level failure union added around every behavior's domain error type.

type

Source

tsflow/core/runtime.ts:259-261
export function isRuntimeError(error: unknown): error is RuntimeError {
return isCancelled(error) || isThrown(error);
}