genroc

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.

CodeReported byMeans
http.timeoutfetchconnected, but no response arrived in time
http.disconnectedfetchthe request went out, the connection broke before a response
pre.timeoutfetchtimed out before the request was written — it never left
pre.errorfetchfailed before the request was written — it never left
result.parsefetchthe response body was not valid JSON
result.too_largefetchthe response body exceeded the size a fetch will read
result.invalidfetch, childthe result did not satisfy the schema declared for it
external.timeoutexternalthe wait deadline elapsed
external.lostexternala worker’s claim expired without an answer
only_once.interruptedonly_oncea 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.

CodeMeans
engine.definitionthe definition is unusable: missing, or it names a task or goto that is not in it
engine.expressionan expression could not be evaluated against this context
engine.configconfig could not be resolved from the environment
engine.inputan input did not satisfy the schema declared for it
engine.outputan output did not satisfy the schema declared for it
engine.spawnspawning children, or arming an external task and reading its answer, failed
engine.collectcollecting a settled batch’s outputs failed
engine.panica Go panic escaped this instance’s advance