Liking cljdoc? Tell your friends :D

wagoe.platform.core.http.errors

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.
raw docstring

bodyclj

(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.
sourceraw docstring

error-body?clj

(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.
sourceraw docstring

responseclj

(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.
sourceraw docstring

status->typeclj

(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.
sourceraw docstring

type-nameclj

(type-name t)

:not-found -> "not-found"; a qualified keyword keeps its namespace.

`:not-found` -> "not-found"; a qualified keyword keeps its namespace.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close