Base exception class which will be caught by call
. Dynamic, defaults to Throwable
. Use catch-from!
or catching
to modify
Base exception class which will be caught by `call`. Dynamic, defaults to `Throwable`. Use `catch-from!` or `catching` to modify
Exception classes which will be ignored by call
. Dynamic, defaults to empty set. Use ignore-exceptions!
, add-ignored-exceptions!
or ignoring
to modify
Exception classes which will be ignored by `call`. Dynamic, defaults to empty set. Use `ignore-exceptions!`, `add-ignored-exceptions!` or `ignoring` to modify
(add-ignored-exceptions! ex-class-set)
Adds given set of classes to *ignored-exceptions*
Adds given set of classes to `*ignored-exceptions*`
(call f & args)
Calls given function with supplied args in try/catch
block. When caught an exception
which class is *catch-from*
or a subclass of it, and is not listed in *ignored-exceptions*
(and is not a subclass of any classes listed there)
returns instance of caught exception, otherwise throws it. If no exception has caught during function call returns its result
Calls given function with supplied args in `try/catch` block. When caught an exception which class is `*catch-from*` or a subclass of it, and is not listed in `*ignored-exceptions*`(and is not a subclass of any classes listed there) returns instance of caught exception, otherwise throws it. If no exception has caught during function call returns its result
(catch-from! ex-class)
Sets exception-base-class to specified class
Sets *exception-base-class* to specified class
(catching exception-base-class & body)
Executes body with *exception-base-class*
bound to given class
Executes body with `*exception-base-class*` bound to given class
(else handler value)
If value is a fail?
, calls handler on it, otherwise returns value
If value is a `fail?`, calls handler on it, otherwise returns value
(else-if ex-class handler value)
If value is an exception of ex-class, applies handler to it, otherwise returns value
If value is an exception of ex-class, applies handler to it, otherwise returns value
(fail)
(fail msg-or-data)
(fail msg data)
(fail msg data cause)
Calls ex-info
with given msg(optional, defaults to nil), data(optional, defaults to {}) and cause(optional, defaults to nil)
Calls `ex-info` with given msg(optional, defaults to nil), data(optional, defaults to {}) and cause(optional, defaults to nil)
(fail! & args)
Constructs fail
with given args and throws it
Constructs `fail` with given args and throws it
(fail? t)
(fail? ex-class t)
Checks if value is exception of given class(optional, defaults to Throwable)
Checks if value is exception of given class(optional, defaults to Throwable)
(flet bindings & body)
Flow adaptation of Clojure let
. Wraps evaluation of each binding to call
. If fail?
value returned from binding evaluation, it's returned immediately and all other bindings and body are skipped
Flow adaptation of Clojure `let`. Wraps evaluation of each binding to `call`. If `fail?` value returned from binding evaluation, it's returned immediately and all other bindings and body are skipped
(ignore-exceptions! ex-class-set)
Sets *ignored-exceptions*
to given set of classes
Sets `*ignored-exceptions*` to given set of classes
(ignored? t)
Checks if exception should be ignored
Checks if exception should be ignored
(ignoring ignored-exceptions & body)
Executes body with *ignored-exceptions*
bound to given value
Executes body with `*ignored-exceptions*` bound to given value
(then handler value)
If value is not a fail?
, applies handler to it wrapped to call
, otherwise returns value
If value is not a `fail?`, applies handler to it wrapped to `call`, otherwise returns value
(thru handler value)
Calls handler on value (for side effects). Returns value. Works similar to doto, but accepts function as first arg
Calls handler on value (for side effects). Returns value. Works similar to doto, but accepts function as first arg
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close