Documentation / guides
Errors
Describe Hustle validation and runtime errors.
Hustle errors identify the boundary and retain only bounded, typed detail.
Inspect them with errors.As; error strings intentionally do not expose raw
prompts, provider responses, endpoints, or tool payloads.
Definition and binding errors
*hustle.DefinitionError uses DefinitionErrorKind values such as
DefinitionMissingName, DefinitionReservedName,
DefinitionDuplicateOption, DefinitionInvalidParticipation,
DefinitionMissingModelSource, DefinitionInvalidClient,
DefinitionInvalidModel, DefinitionInvalidTimeout,
DefinitionInvalidLimits, DefinitionInvalidSystemPrompt,
DefinitionInvalidPromptRevision, DefinitionMissingPolicyRevision,
DefinitionInvalidOutputSchema, DefinitionInvalidEvidenceTools, and
DefinitionInvalidRetryPolicy.
*hustle.BindError reports BindInvalidDefinition, BindInvalidContext,
BindMissingModelResolver, or BindInvalidEvidenceTools.
Proof: definition error kinds and validation tests.
Model and execution errors
*hustle.ResolveError reports ResolveInvalidContext, ResolveInvalidLoopID,
ResolveModelFailed, or ResolveInvalidBinding. Internal admission and
execution errors are separated:
| Type | Boundary | Important values |
|---|---|---|
AdmissionError | Before ownership | invalid_context, invalid_participation, nil_finalizer, run_id, full, closed, poisoned. |
RequestError | Preflight before ownership | runtime_unavailable, unknown_definition, invalid_cause, invalid_input, input_too_large, nil_validator. |
QueueFailureError | Owned but waiting | canceled, timeout, closed, poisoned. |
RunError | Owned execution | Stage and hustle.ReasonCode, plus terminal/finalizer/cleanup causes. |
Proof: resolve errors, runtime errors, and preflight tests.
Output, evidence, and shutdown errors
OutputError classifies invalid shape, empty text, oversized output, or
invalid JSON. EvidenceError uses bounded reasons for binding, authorization,
containment, execution, result/evidence limits, rounds/calls, cancellation,
deadline, and internal faults. WorkerPanicError and WorkerPoisonError
redact panic/provider details. FinalizerError, ActivityError, AuditError,
and CloseError preserve cleanup context without rewriting the primary result.
Proof: bounded error vocabulary and advanced failure tests.
Model-facing rendering
Tool and facility adapters render only a bounded category to model-facing
output. Trusted application code can use typed causes and errors.Is; a model
must not receive an error string containing request bytes, credentials, or
provider diagnostics.
Proof: tool and execution error handling and output redaction tests.