Liking cljdoc? Tell your friends :D

com.blockether.anomaly.core

Cognitect Anomalies - standardized error categories.

Based on https://github.com/cognitect-labs/anomalies

Anomalies are maps with ::category key indicating the error type. These map to HTTP status codes:

CategoryHTTPDescription
::unavailable503Service temporarily unavailable, retry later
::interrupted500Operation was interrupted
::incorrect400Bad request, invalid input
::forbidden403Not authorized to perform this action
::unauthorized401Authentication required
::not-found404Resource not found
::conflict409Conflict with current state (e.g., duplicate)
::fault500Internal server error
::busy503Server is busy, retry later
::unsupported501Operation not supported

Usage: (throw! ::forbidden "You are not authorized to access this resource") (throw! ::not-found "Therapy plan not found" {:plan-id plan-id}) (throw! ::incorrect "Invalid email format" {:field :email})

Cognitect Anomalies - standardized error categories.

Based on https://github.com/cognitect-labs/anomalies

Anomalies are maps with ::category key indicating the error type.
These map to HTTP status codes:

| Category      | HTTP | Description                                    |
|---------------|------|------------------------------------------------|
| ::unavailable | 503  | Service temporarily unavailable, retry later   |
| ::interrupted | 500  | Operation was interrupted                      |
| ::incorrect   | 400  | Bad request, invalid input                     |
| ::forbidden   | 403  | Not authorized to perform this action          |
| ::unauthorized| 401  | Authentication required                        |
| ::not-found   | 404  | Resource not found                             |
| ::conflict    | 409  | Conflict with current state (e.g., duplicate)  |
| ::fault       | 500  | Internal server error                          |
| ::busy        | 503  | Server is busy, retry later                    |
| ::unsupported | 501  | Operation not supported                        |

Usage:
(throw! ::forbidden "You are not authorized to access this resource")
(throw! ::not-found "Therapy plan not found" {:plan-id plan-id})
(throw! ::incorrect "Invalid email format" {:field :email})
raw 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