Liking cljdoc? Tell your friends :D

anomalies-tools.core


!!clj

source

*default-category*clj

Default category for new anomaly created with constructor or produced with catch-anomaly and its variations if no category specified

Default category for new anomaly created with constructor
or produced with catch-anomaly and its variations if no category specified
sourceraw docstring

*exception-categories*clj

Map containing Java exception classes and corresponding categories. Used to determine category in catch-anomaly and its variations if no category specified

Map containing Java exception classes and corresponding categories.
Used to determine category in catch-anomaly and its variations if no category specified
sourceraw docstring

-alet-implcljmacro

(-alet-impl bindings & body)
source

aletcljmacro

(alet bindings & body)

Anomaly aware version of let, if any of given bindings is evaluated to anomaly, it's returned immediately, otherwise body evaluation result is returned

Anomaly aware version of let, if any of given bindings is evaluated to anomaly, it's returned immediately,
otherwise body evaluation result is returned
sourceraw docstring

anomalyclj

(anomaly)
(anomaly cat-msg-data)
(anomaly cat-msg msg-data)
(anomaly cat msg data)

Creates new anomaly with given category(defaults to ::fault) message(optional) and data(optional)

Creates new anomaly with given category(defaults to ::fault) message(optional) and data(optional)
sourceraw docstring

anomaly?clj

(anomaly? x)

Checks if given value is anomaly

Checks if given value is anomaly
sourceraw docstring

awareclj

(aware f)
(aware f v)

Creates anomaly-aware wrapper for given 1-arity function. Wrapper calls function if no anomaly argument given and returns argument otherwise.

Creates anomaly-aware wrapper for given 1-arity function.
Wrapper calls function if no anomaly argument given and returns argument otherwise.
sourceraw docstring

aware->cljmacro

(aware-> expr & forms)

When expr is not anomaly, threads it into the first form (via ->), and when that result is not anomaly, through the next etc

When expr is not anomaly, threads it into the first form (via ->),
and when that result is not anomaly, through the next etc
sourceraw docstring

aware->>cljmacro

(aware->> expr & forms)

When expr is not anomaly, threads it into the first form (via ->>), and when that result is not anomaly, through the next etc

When expr is not anomaly, threads it into the first form (via ->>),
and when that result is not anomaly, through the next etc
sourceraw docstring

busyclj

source

catch-allcljmacro

(catch-all & body)

Turns all exceptions into anomalies

Turns all exceptions into anomalies
sourceraw docstring

catch-anomalycljmacro

(catch-anomaly options & body)

Wraps given body to try/catch, turning thrown exceptions into anomalies. First argument should be map of settings or nil(each setting is optional) :category - assigns given category to produced anomaly (default-category is used if nothing specied) :message - assigns given message to produced anomaly (exception message when present is used if nothing specified) :data - assigns given value as data of produced anomaly (exception itself is used if nothing specified) :only - set of exceptions which will be turned into anomalies(other exceptions will be thrown) :except - set of exceptions which will be thrown(other exceptions will be turned into anomalies) :only and :except are mutually exclusive

Wraps given body to try/catch, turning thrown exceptions into anomalies.
First argument should be map of settings or nil(each setting is optional)
:category - assigns given category to produced anomaly (*default-category* is used if nothing specied)
:message - assigns given message to produced anomaly (exception message when present is used if nothing specified)
:data - assigns given value as data of produced anomaly (exception itself is used if nothing specified)
:only - set of exceptions which will be turned into anomalies(other exceptions will be thrown)
:except - set of exceptions which will be thrown(other exceptions will be turned into anomalies)
:only and :except are mutually exclusive
sourceraw docstring

catch-exceptcljmacro

(catch-except ex & body)

Throws exceptions of given classes, other exceptions are turned into anomalies

Throws exceptions of given classes, other exceptions are turned into anomalies
sourceraw docstring

catch-onlycljmacro

(catch-only ex & body)

Turns exceptions of given classes set into anomalies, other exceptions are thrown

Turns exceptions of given classes set into anomalies, other exceptions are thrown
sourceraw docstring

categoryclj

source

caughtclj

(caught v & f)

Creates anomaly-centric function call chain for given value. If given value is not anomaly, it's returned immediately and chain is skipped. If some function in chain returns anomaly, then new anomaly comes to next function in chain, otherwise initial anomaly is passed to next function

Creates anomaly-centric function call chain for given value.
If given value is not anomaly, it's returned immediately and chain is skipped.
If some function in chain returns anomaly, then new anomaly comes to next function in chain,
otherwise initial anomaly is passed to next function
sourceraw docstring

chainclj

(chain v & f)

Creates anomaly-aware function call chain for given value. If given value is anomaly or any function in chain returns anomaly, it's returned immediately, rest of the chain is skipped

Creates anomaly-aware function call chain for given value.
If given value is anomaly or any function in chain returns anomaly,
it's returned immediately, rest of the chain is skipped
sourceraw docstring

conflictclj

source

dataclj

source

eitherclj

(either v other & others)

If any of given arguments (min 2) is not anomaly, returns it, otherwise returns last given argument

If any of given arguments (min 2) is not anomaly, returns it,
otherwise returns last given argument
sourceraw docstring

faultclj

source

forbiddenclj

source

incorrectclj

source

interruptedclj

source

messageclj

source

not-foundclj

source

rescueclj

(rescue f)
(rescue f v)

Creates anomaly-aware wrapper for given 1-arity function. Wrapper calls function if anomaly argument given and returns argument otherwise.

Creates anomaly-aware wrapper for given 1-arity function.
Wrapper calls function if anomaly argument given and returns argument otherwise.
sourceraw docstring

unavailableclj

source

unsupportedclj

source

valid-category?clj

(valid-category? cat)

Checks if given category exists in the list of categories

Checks if given category exists in the list of categories
sourceraw docstring

with-default-categorycljmacro

(with-default-category default-category & body)

Sets given category as default-category while executing body. Given category should be valid one

Sets given category as *default-category* while executing body.
Given category should be valid one
sourceraw docstring

with-exception-categoriescljmacro

(with-exception-categories exception-categories & body)

Sets given map as exception-categories while executing body

Sets given map as *exception-categories* while executing body
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close