Skip to main content

Module error

Module error 

Source
Expand description

The error envelope and the closed set of error codes.

Every rejection the hub makes has the same shape:

422 { "errors": [ { "path": "results[0].metric", "code": "metric_id_invalid", "hint": "..." }, ... ] }

Validation collects all errors before returning, so a producer fixes a record in one round trip rather than one error at a time. path is a JSON-pointer-like location in the submitted record; code is one of the variants below and is listed as an enum in the OpenAPI document; hint is prose for a human and is not part of the contract.

CodeStatusMeaning
schema422JSON Schema violation (unknown key, wrong type, missing required)
number_too_large422integer outside ±2^53
counts_missing422results non-empty but no counts
counts_inconsistent422attempted < completed + failed + skipped + errored
attachment_ref_unknown422samples_ref / calls / artifacts[] not in attachments[].path
attachment_path_invalid422duplicate, .., or absolute attachments[].path
metric_id_invalid422results[].metric not of the form {ns}/{name}
type_mismatch422query: operator applied to a path of another type
not_indexed422query: operator needs an index the path does not have
unknown_path422query: path not in the schema
attachment_missing409attachments[].sha256 not uploaded and confirmed
label_in_use409@{label} already names another version
namespace_in_use409the organisation slug is already a user or an organisation
registry_entry_exists409that registry address is taken; entries are immutable

Other statuses carry no body of this shape: 404 for anything the caller may not know exists (including private records), 403 for a token without the scope, 401 for no or an invalid token, 400 for a body that is not JSON.

Codes are added, never renamed or reused. A client switching on code must treat an unknown code as a generic 422.

Structs§

ErrorEntry
One rejection.
ErrorEnvelope
The body of every 422 and 409 response.

Enums§

ErrorCode
The closed set of error codes.