Skip to content

Error Handling

Directory returns errors as RFC 7807 Problem Details with a stable code field alongside the standard fields. Responses use Content-Type: application/problem+json.

Error Response Structure

{
"type": "https://drs.xyz/errors/address-not-found",
"title": "Address not found",
"status": 404,
"code": "ADDRESS_NOT_FOUND",
"detail": "No active address found for \"nobody\"",
"field": "address"
}
FieldTypeDescription
typestringStable URI identifying the error kind
titlestringShort, human-readable title
statusintegerHTTP status code
codestringMachine-readable error code
detailstringOptional longer explanation
fieldstringOptional offending field path

Implementations MAY add additional fields. Clients MUST ignore unknown fields.

Error Codes

CodeStatusMeaning
INVALID_REQUEST400Missing or malformed field, bad JSON, failed normalization
ADDRESS_NOT_FOUND404No active address exists for the local part
PAYLOAD_TOO_LARGE413Request body exceeds the 4 KiB limit
UNSUPPORTED_MEDIA_TYPE415Content-Type must be application/json
INTERNAL_ERROR500Unexpected server error
KV_UNAVAILABLE503Storage backend unreachable

Client-side verification failures are not HTTP responses — they are returned by the client library:

Client errorWhen
INVALID_SIGNATUREEd25519 verification failed against every published key
EXPIRED_CONTRACTexpires_at is in the past beyond clock-skew tolerance
NOT_YET_VALIDissued_at is in the future beyond clock-skew tolerance

Design Rationale

DNS returns NXDOMAIN or an answer. HTTP returns a status code. Directory follows the same pattern. The protocol is a query and a response — it either resolves or it doesn’t. Complex error taxonomies belong in the operator’s implementation, not in the protocol.

Client Behavior

  • 400 — fix the request. Check the field value.
  • 404 — the address doesn’t exist. Don’t retry.
  • 413 / 415 — client bug. Don’t retry.
  • 500 — server error. May retry with backoff.
  • 503 — temporary unavailability. Retry after a delay.
  • Verification failure — refetch _drskey records once and retry before failing.