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
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
(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
(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)
(anomaly? x)
Checks if given value is anomaly
Checks if given value is anomaly
(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.
(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
(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
(catch-all & body)
Turns all exceptions into anomalies
Turns all exceptions into anomalies
(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
(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
(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
(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
(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
(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
(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.
(valid-category? cat)
Checks if given category exists in the list of categories
Checks if given category exists in the list of categories
(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
(with-exception-categories exception-categories & body)
Sets given map as exception-categories while executing body
Sets given map as *exception-categories* while executing body
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close