Utility functions for working with anomaly maps.
Utility functions for working with anomaly maps.
(! anomaly)
Throw anomaly
as an ExceptionInfo
.
Throw `anomaly` as an `ExceptionInfo`.
(?! x)
(?! x & {:keys [extra-data]})
Throw x
if it is an anomaly, else x
.
Throw `x` if it is an anomaly, else `x`.
(anomaly category)
(anomaly category message)
(anomaly category message data)
(anomaly category message data cause-ex)
Returns an anomaly map constructed from category
and, optionally, message
.
Returns an anomaly map constructed from `category` and, optionally, `message`.
(anomaly? x)
Returns true if x
is an anomaly.
Returns true if `x` is an anomaly.
(busy message)
(busy message data)
(busy message data cause-ex)
backoff and retry
backoff and retry
(busy! message)
(busy! message data)
(busy! message data cause-ex)
backoff and retry, throwing
backoff and retry, throwing
(busy? x)
(category x)
Returns the anomaly category of x
.
Returns the anomaly category of `x`.
A default mapping from anomaly category to an HTTP status code. Note that a single category can map to multiple HTTP status codes.
A default mapping from anomaly category to an HTTP status code. Note that a single category can map to multiple HTTP status codes.
(category-from-http-status http-status)
(category-from-http-status http-status default-category)
(conflict message)
(conflict message data)
(conflict message data cause-ex)
coordinate with callee
coordinate with callee
(conflict! message)
(conflict! message data)
(conflict! message data cause-ex)
coordinate with callee, throwing
coordinate with callee, throwing
(conflict? x)
(default-ex-anomaly {:keys [throwable]})
(ex anomaly)
(ex->anomaly throwable)
(ex->anomaly throwable {:keys [converters default-converter]})
Returns an anomaly map from the given throwable
. Optionally takes an argument
map of the following keys:
converters: Seq of functions where each function takes a map containing the
throwable under the :throwable
key and returns an anomaly map or nil if
no anomaly can be produced from the converter. Defaults to default-ex->anomaly-converters
.
default-converter: The converter function called when no converter in :converters
returns an anomaly map. Defaults to default-ex-anomaly
.
Returns an anomaly map from the given `throwable`. Optionally takes an argument map of the following keys: converters: Seq of functions where each function takes a map containing the throwable under the `:throwable` key and returns an anomaly map or nil if no anomaly can be produced from the converter. Defaults to [[default-ex->anomaly-converters]]. default-converter: The converter function called when no converter in `:converters` returns an anomaly map. Defaults to [[default-ex-anomaly]].
(fault message)
(fault message data)
(fault message data cause-ex)
fix callee bug
fix callee bug
(fault! message)
(fault! message data)
(fault! message data cause-ex)
fix callee bug, throwing
fix callee bug, throwing
(fault? x)
(forbidden message)
(forbidden message data)
(forbidden message data cause-ex)
fix caller creds
fix caller creds
(forbidden! message)
(forbidden! message data)
(forbidden! message data cause-ex)
fix caller creds, throwing
fix caller creds, throwing
(forbidden? x)
Map of HTTP status code to anomaly category.
Map of HTTP status code to anomaly category.
(incorrect message)
(incorrect message data)
(incorrect message data cause-ex)
fix caller bug
fix caller bug
(incorrect! message)
(incorrect! message data)
(incorrect! message data cause-ex)
fix caller bug
fix caller bug
(incorrect? x)
(interrupted message)
(interrupted message data)
(interrupted message data cause-ex)
stop interrupting
stop interrupting
(interrupted! message)
(interrupted! message data)
(interrupted! message data cause-ex)
stop interrupting, throwing
stop interrupting, throwing
(interrupted? x)
(message x)
Returns the anomaly message of x
.
Returns the anomaly message of `x`.
(not-found message)
(not-found message data)
(not-found message data cause-ex)
fix caller noun
fix caller noun
(not-found! message)
(not-found! message data)
(not-found! message data cause-ex)
fix caller noun, throwing
fix caller noun, throwing
(not-found? x)
(public-data anom-data)
Returns a map of the public data from anom-data
.
Returns a map of the public data from `anom-data`.
Set of anomaly categories that are retryable.
Set of anomaly categories that are retryable.
(retryable? anomaly)
Returns true if a replay of the same activity might reasonably lead to a different outcome.
Returns true if a replay of the same activity might reasonably lead to a different outcome.
(some x)
Returns x when x is an anomaly, else nil.
Returns x when x is an anomaly, else nil.
(unavailable message)
(unavailable message data)
(unavailable message data cause-ex)
make sure callee healthy
make sure callee healthy
(unavailable! message)
(unavailable! message data)
(unavailable! message data cause-ex)
make sure callee healthy, throwing
make sure callee healthy, throwing
(unavailable? x)
(unsupported message)
(unsupported message data)
(unsupported message data cause-ex)
fix caller verb
fix caller verb
(unsupported! message)
(unsupported! message data)
(unsupported! message data cause-ex)
fix caller verb, throwing
fix caller verb, throwing
(unsupported? x)
(with-ex anomaly ex)
Associates ex with the anomaly.
Associates ex with the anomaly.
(with-public-ks anom-data ks)
Adds ks
to the set of public keys for anom-data
.
Adds `ks` to the set of public keys for `anom-data`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close