docs / Reference / Definition language
Task errors
The codes a task can fail with, and which of them an on_error rule can catch.
Catchable
An on_error rule matches these by code. Reported by is the kind of
task that produces the code — a rule naming one its task cannot produce is refused at
registration.
| Code | Reported by | Means |
|---|---|---|
http.timeout | fetch | connected, but no response arrived in time |
http.disconnected | fetch | the request went out, the connection broke before a response |
pre.timeout | fetch | timed out before the request was written — it never left |
pre.error | fetch | failed before the request was written — it never left |
result.parse | fetch | the response body was not valid JSON |
result.too_large | fetch | the response body exceeded the size a fetch will read |
result.invalid | fetch, child | the result did not satisfy the schema declared for it |
external.timeout | external | the wait deadline elapsed |
external.lost | external | a worker’s claim expired without an answer |
only_once.interrupted | only_once | a previous attempt was interrupted — route it, never retry |
HTTP status codes
A fetch whose response status is not accepted fails with http.<status> —
http.500, http.404. The family is unbounded, so it has no table: match it with a
pattern, http.5%.
Terminal
These fail the instance outright. No on_error rule sees one, so none can be
caught or retried; they are listed because every failure stores a code and these are what
error_code then holds.
| Code | Means |
|---|---|
engine.definition | the definition is unusable: missing, or it names a task or goto that is not in it |
engine.expression | an expression could not be evaluated against this context |
engine.config | config could not be resolved from the environment |
engine.input | an input did not satisfy the schema declared for it |
engine.output | an output did not satisfy the schema declared for it |
engine.spawn | spawning children, or arming an external task and reading its answer, failed |
engine.collect | collecting a settled batch’s outputs failed |
engine.panic | a Go panic escaped this instance’s advance |