Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/agent / errors
errors
Typed error surface for @graphorin/agent.
Every error class extends the base AgentRuntimeError which is a thin wrapper around Error with a stable code discriminator so callers can switch on it without parsing messages.
Classes
| Class | Description |
|---|---|
| AgentResolutionError | Thrown by RunState.fromJSON(...) when the agent name in the serialized state cannot be resolved against the supplied agent graph (renamed agent / removed handoff). |
| AgentRuntimeError | Base class for every error thrown from @graphorin/agent. |
| EvaluatorOptimizerConfigError | Thrown by evaluatorOptimizer({...}) when maxIterations < 1 at construction time. The helper purposely surfaces the misuse early rather than failing on the first run. |
| InvalidAgentConfigError | Thrown by createAgent({...}) when the supplied options fail structural validation (missing provider, empty name, both outputType: 'text' and outputSchema declared, ...). |
| InvalidPreferredModelError | Thrown by createAgent({...}) when preferredModel carries an unknown literal (any value outside the `'fast' |
| MergeBlockedError | Thrown by Agent.fanOut(...) when the configured MergeAgentSidewaysInjectionGuard fires with strictness 'detect-and-block'. |
| MultipleHandoffsInStepError | Thrown when the model invokes more than one handoff (transfer_to_*) tool in a single response. Per the agent-loop documentation this is an error rather than a silent drop. |
| ProgressWriteError | Thrown by agent.progress.write(...) when the atomic write fails (disk full, permission denied, ...). The partial .tmp file is unlinked before the error propagates. |
| ProtocolInjectionRejectError | Thrown by the protocol-injection guard when the operator selected the strictest deployment posture (escapePolicy: 'reject') and a tool result body carries control characters at the corresponding outbound boundary. |
| ProviderMiddlewareOrderError | Thrown by createAgent({...}) when the supplied composeProviderMiddleware chain violates the canonical inside-out ordering (DEC-145 / ADR-039). |
| RunStateMalformedError | Thrown by RunState.fromJSON(...) when the supplied JSON does not shape-match the documented SerializedRunState. |
| RunStateVersionUnsupportedError | Thrown by RunState.fromJSON(...) when the version field in the serialized state is from a future major version of the framework. |
| ToolNotFoundError | Thrown by the agent loop when the model emits a tool call referring to an unregistered tool (the model hallucinated a name). |
Type Aliases
| Type Alias | Description |
|---|---|
| AgentRuntimeErrorCode | Stable code discriminator surfaced on every AgentRuntimeError. |