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 (WGE 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 pure part lives in wagoe.core.http.errors (BOU-930); this namespace adds what needs JSON.

The one JSON error body (BOU-586):

  {"error": {"type":           "not-found",
             "message":        "User not found",
             "details":        {...},    ; optional
             "correlation-id": "...",  ; optional
             "dev":            {...}}}   ; optional, dev only (WGE 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 pure part lives in `wagoe.core.http.errors` (BOU-930); this
namespace adds what needs JSON.
raw docstring

bodyclj

(body type message)
(body type message opts)

See wagoe.core.http.errors/body.

See `wagoe.core.http.errors/body`.
sourceraw docstring

error-body?clj

(error-body? b)

See wagoe.core.http.errors/error-body?.

See `wagoe.core.http.errors/error-body?`.
sourceraw docstring

error-ofclj

(error-of response)

The error map of response's body, a map or JSON a handler encoded itself; nil when it carries none.

The `error` map of `response`'s body, a map or JSON a handler encoded
itself; nil when it carries none.
sourceraw docstring

responseclj

(response status type message)
(response status type message opts)

See wagoe.core.http.errors/response.

See `wagoe.core.http.errors/response`.
sourceraw docstring

status->typeclj

(status->type status)

See wagoe.core.http.errors/status->type.

See `wagoe.core.http.errors/status->type`.
sourceraw docstring

type-nameclj

(type-name t)

See wagoe.core.http.errors/type-name.

See `wagoe.core.http.errors/type-name`.
sourceraw docstring

with-correlation-idclj

(with-correlation-id {:keys [status] :as response} correlation-id)

response with correlation-id in its error body when it has none: for the bodies handlers build themselves, encoded or not (BOU-592).

`response` with `correlation-id` in its error body when it has none: for
the bodies handlers build themselves, encoded or not (BOU-592).
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