Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / errors

errors

Typed error classes for @graphorin/tools.

Every error carries a lowercase kind discriminator and (where relevant) a human-readable hint field surfaced in CLI output. Never throw plain Error from framework code — the runtime depends on the kind discriminator to drive recovery / replay logic.

Classes

ClassDescription
DuplicateToolNameErrorThrown when two registrations collide on the no-arguments ToolRegistry.assertNoDuplicates() signature. First-party / inline tool({...}) collisions are programming errors that fail-fast.
GraphorinToolsErrorCommon base for every @graphorin/tools error.
InvalidExampleErrorThrown when an examples entry fails the registration-time Zod validation against the tool's inputSchema / outputSchema.
InvalidPreferredModelErrorThrown when a tool's preferredModel field does not parse as a ModelHint literal OR a structurally-valid ModelSpec.
InvalidSideEffectClassErrorThrown when a tool declares a sideEffectClass value outside the canonical four-value union. The TypeScript type system catches this at compile time; the runtime check is the second line of defence for projects that bypass type-checking.
ToolCollisionErrorThrown by the strategy-aware ToolRegistry.assertNoDuplicates(...) overload when the operator selected the 'manual' strategy and the dispatcher has no automatic resolution path.
ToolExecutionAggregateErrorThrown when an aggregate parallel batch fails. Carries every per-tool failure for observability + structured retry.