Expand description
Error codes, their classes, and the two error shapes of classify.run.
An admission refusal answers the whole request with an ERROR frame
whose body is {code, message, detail} (Refusal); it writes nothing
and dispatches nothing. After admission the batch never fails as a
whole: an item that could not be answered carries an ItemError in
its place in the reply.
Codes are open strings on the wire: a code this crate does not list is
kept as it was sent. Classes decode open too (ErrorClass::Other); a
caller that meets an unknown class treats it as permanent
(ErrorClass::effective), which is the safe direction.
Modules§
- classes
- Class names. The set is fixed for
classifier/v1; a new class means a new role version.
Structs§
- Item
Error - An item’s error in a
classify.runreply:{code, class, message, retry_after_ms?}. - Refusal
- An admission refusal: the body of the
ERRORframeclassify.runanswers with,{code, message, detail}, the shape ofsubc_protocol::ErrorBodywith a typed detail. - Refusal
Detail - The
detailof an admission refusal. Which members are present depends on the code (see the contract’s table);classis always present, so a caller that meets an unknown code still knows whether to retry.
Enums§
- Error
Class - An error class. Decodes open: a value other than
classesis kept inErrorClass::Other. Non-exhaustive, so a match needs a wildcard arm and adding a variant later is not a breaking change.
Constants§
- ACCOUNT_
WALLED - The provider account is at its limit.
detail.resets_at_mswhen known. Transient. - ADMISSION_
CODES - Every admission refusal code, in the contract’s table order.
- AUTH_
FAILED - The provider refused the module’s credentials (HTTP 401 or 403). Permanent. As an admission refusal: the call’s first provider call met it, so the whole call is refused and nothing is written. As a per-item error: it stopped the call, and every item the call left unanswered carries it. Never stored, so a re-send after a re-login asks the provider again.
- BATCH_
ID_ REUSE - The
batch_idnames a recorded batch whose body differs.detail.fieldnames the first differing field. Permanent. - BATCH_
IN_ PROGRESS - Another call holds this
batch_id.detail.retry_after_mssays when to re-send. Transient. Nothing was written or dispatched. - COST_
EXCEEDED - As an admission refusal: the batch’s estimated cost is over
max_cost_usd;detail.estimate_usdanddetail.max_cost_usdcarry both. As a per-item error: answering the item would cross the batch’s ceiling. Permanent either way. - INVALID_
ITEM - The provider rejected this item’s input (400, 413, 422, or another 4xx the contract does not map elsewhere). Permanent.
- INVALID_
PARAMS - A malformed request, or a limit exceeded.
detail.fieldnames the field, anddetail.limitthe limit where one applies. Permanent. - ITEM_
CODES - Every per-item error code, in the contract’s table order.
cost_exceeded,auth_failedandmodel_unavailableare both admission refusals and per-item errors. - MODEL_
NOT_ CLASSIFIER - The model’s catalog row is not a classifier.
detail.modelanddetail.kindname it and its kind. Permanent. - MODEL_
UNAVAILABLE - The provider does not serve the model (HTTP 404). Permanent. As an
admission refusal,
detail.modelnames the model; the call’s first provider call met it, so the whole call is refused and nothing is written. As a per-item error: it stopped the call, and every item the call left unanswered carries it. Never stored, so a re-send after a catalog fix asks the provider again. - MODEL_
UNKNOWN - The model is not in the runner’s catalog.
detail.modelnames it. Permanent. - PROVIDER_
ERROR - The provider answered 5xx, or the transport failed, after the runner’s own retries. Transient.
- PROVIDER_
REFUSED - The provider refused the content. Permanent.
- RATE_
LIMITED - The provider answered 429 or 529 after the runner’s own retries.
retry_after_mswhen the provider gave one. Transient. It stops the call: the items after it that would need a provider call are not sent, and carryrate_limitedtoo, unstored, so a re-send retries them.
Functions§
- admission_
class - The class of an admission refusal code this crate lists,
Nonefor any other code. - item_
class - The class of a per-item error code this crate lists,
Nonefor any other code.