Problem types

Every problem.type this implementation mints, what it means, and what a client should do about it.

Every 4xx and 5xx carries an RFC 9457 problem body whose type is an absolute URI under https://hupe1980.github.io/openadr/problems/. RFC 9457 asks that dereferencing such a URI produce documentation of the type; each one below is that documentation.

openadr explain <type> prints the same text at a terminal.

The type is the stable identifier — match on it, not on title or detail, which are prose and may be reworded. status repeats the HTTP status so a stored problem is still complete.

What a client should do#

typeStatusMeaning
bad-request400The request is malformed in a way the more specific types below do not cover. Not retryable unchanged.
invalid-payload400The body parsed as JSON but failed validation — a field out of range, a missing required property, a pattern that does not match. detail names the field.
dangling-reference400The body refers to an object that does not exist, typically a programID on an event. The URL was fine; the payload was not.
unsupported-media-type415The body was labelled something other than application/json or an RFC 6839 +json type.
payload-too-large413The body exceeds the VTN's configured limit.
unauthorized401No credential, or one that did not verify. The response carries WWW-Authenticate. Get a new token and retry once.
missing-scope403The token verified but does not carry the scope this endpoint requires. Retrying will not help; the client's registration needs changing.
forbidden403The credential is valid and scoped but may not act on this object — a VEN writing another VEN's report, for instance.
not-found404No such object. Also returned for an object that exists but this client may not see, so that a 403 never confirms existence.
no-such-route404No endpoint at that path. Usually a base-path or version mistake rather than a missing object.
method-not-allowed405The path exists; the method is not defined for it.
conflict409The write lost a race, or would break uniqueness. Re-read and retry.
not-implemented501A specified feature this deployment does not provide — the MQTT topic endpoints on a VTN with no broker, for example.
internal-server-error500A defect. instance is the request id; quote it.
storage-unavailable500The database could not be reached. Transient; retry with backoff.
unavailable503The VTN is up but declining work, typically while shutting down. Retry with backoff.
timeout504The VTN gave up on the request. Retry with backoff.
errorvariesA status produced by a middleware with no more specific mapping.
unexpectedvariesMinted by this crate's client, not by a VTN: the peer returned an error with no problem body, so one was synthesised from the status. It says nothing about the peer beyond its status code.

POST /auth/token is the exception. Its errors are RFC 6749 §5.2 authError bodies ({"error": "invalid_client", …}) rather than problems, because that is the shape OAuth clients parse.