The one JSON error body (BOU-586):
{"error": {"type": "not-found", "message": "User not found", "details": {...}, ; optional "correlation-id": "...", ; optional "dev": {...}}} ; optional, dev only (BND code)
Everything about the failure sits inside error, so a client reads one
key. type is a string: the :type keyword of the ex-info, without its
colon.
The one JSON error body (BOU-586):
{"error": {"type": "not-found",
"message": "User not found",
"details": {...}, ; optional
"correlation-id": "...", ; optional
"dev": {...}}} ; optional, dev only (BND code)
Everything about the failure sits inside `error`, so a client reads one
key. `type` is a string: the `:type` keyword of the ex-info, without its
colon.(body type message)(body type message {:keys [details correlation-id dev]})The error body. details is left out when empty.
The error body. `details` is left out when empty.
(error-body? b)Whether b is in the one shape — with keyword or string keys, so it can
judge a decoded JSON body as well as a map.
Whether `b` is in the one shape — with keyword or string keys, so it can judge a decoded JSON body as well as a map.
(response status type message)(response status type message {:keys [correlation-id] :as opts})A Ring response carrying body. No Content-Type: muuntaja encodes a map
body only when none is set (ZZP-120). The correlation id, when given, is
echoed in the X-Correlation-ID header too.
A Ring response carrying `body`. No Content-Type: muuntaja encodes a map body only when none is set (ZZP-120). The correlation id, when given, is echoed in the X-Correlation-ID header too.
(status->type status)The :type a handler that knows only its status answers with: ADR-022's
vocabulary where it has a word, :validation-error for any other 4xx and
:internal-error for any other 5xx.
The `:type` a handler that knows only its status answers with: ADR-022's vocabulary where it has a word, `:validation-error` for any other 4xx and `:internal-error` for any other 5xx.
(type-name t):not-found -> "not-found"; a qualified keyword keeps its namespace.
`:not-found` -> "not-found"; a qualified keyword keeps its namespace.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |