eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
20 lines • 1.11 kB
TypeScript
import { type RunErrorCode, WorkflowWorldError } from '#compiled/@workflow/errors/index.js';
/**
* Classify an error that caused a workflow run to fail.
*
* After the structural separation of infrastructure vs user code error
* handling, the only errors that reach the `run_failed` try/catch are:
* - User code errors (throws from workflow functions, propagated step failures)
* - WorkflowRuntimeError and subclasses (missing timestamps, workflow/step
* not registered, corrupted event log, etc.)
*
* Uses each subclass's `.is()` static (a name-based duck check) instead of
* a single `instanceof` check because workflows execute in a separate
* `vm` realm: the VM-context `WorkflowRuntimeError` and the host-context
* one are distinct classes, so `instanceof` returns `false` for any error
* thrown inside the workflow VM and we'd misclassify genuine runtime
* errors as user errors.
*/
export declare function isWorldContractError(err: unknown): err is WorkflowWorldError;
export declare function classifyRunError(err: unknown): RunErrorCode;
//# sourceMappingURL=classify-error.d.ts.map