(ancestors tag)
Like clojure.core/ancestors but scoped on our ex-info type hierarchy
Like clojure.core/ancestors but scoped on our ex-info type hierarchy
(assert-ex-data-valid ex-data)
ex-data Validator function
ex-data Validator function
(catch-data* e type-key handler continue)
catch-data as a function, takes an exception, tries to match it
against type-key
from its ex-data.type, on match returns call to
handler
with the ex-data, otherwise continue
with the original
exception.
catch-data as a function, takes an exception, tries to match it against `type-key` from its ex-data.type, on match returns call to `handler` with the ex-data, otherwise `continue` with the original exception.
(derive tag parent)
Like clojure.core/derive but scoped on our ex-info type hierarchy
Like clojure.core/derive but scoped on our ex-info type hierarchy
(descendants tag)
Like clojure.core/descendants but scoped on our ex-info type hierarchy
Like clojure.core/descendants but scoped on our ex-info type hierarchy
(ex-info msg type)
(ex-info msg type data)
(ex-info msg type data cause)
Like clojure.core/ex-info
but adds validation of the ex-data,
automatic setting of the data :type
from argument and potential
derivation. You can specify type as either a keyword or a tuple of
[<type> [<derivation>+]]
.
Like `clojure.core/ex-info` but adds validation of the ex-data, automatic setting of the data `:type` from argument and potential derivation. You can specify type as either a keyword or a tuple of `[<type> [<derivation>+]]`.
(isa? child parent)
Like clojure.core/isa? but scoped on our ex-info type hierarchy
Like clojure.core/isa? but scoped on our ex-info type hierarchy
(parents tag)
Like clojure.core/parents but scoped on our ex-info type hierarchy
Like clojure.core/parents but scoped on our ex-info type hierarchy
(set-ex-data-spec! type spec)
(set-validator! f)
Sets validation failure handler globally
Sets validation failure handler globally
(try+ & xs)
Like try but with support for ex-info/ex-data.
If you pass a catch-data
form it will try to match an
ex-info :type key, or it's potential ancestors in the local hierarchy.
ex-info clauses are checked first, in the order they were specified. catch-data will take as arguments a :type key, and a binding for the ex-data of the ex-info instance.
(try [...] (catch-data ::something my-ex-data (do-something my-ex-info)) (catch-data ::something-else {:as my-ex-data :keys [foo bar]} (do-something foo bar)) (catch Exception e (do-something e)) (catch OtherException e (do-something e)) (finally :and-done))
You can specify normal catch clauses for regular java errors and/or finally these are left untouched.
Like try but with support for ex-info/ex-data. If you pass a `catch-data` form it will try to match an ex-info :type key, or it's potential ancestors in the local hierarchy. ex-info clauses are checked first, in the order they were specified. catch-data will take as arguments a :type key, and a binding for the ex-data of the ex-info instance. (try [...] (catch-data ::something my-ex-data (do-something my-ex-info)) (catch-data ::something-else {:as my-ex-data :keys [foo bar]} (do-something foo bar)) (catch Exception e (do-something e)) (catch OtherException e (do-something e)) (finally :and-done)) You can specify normal catch clauses for regular java errors and/or finally these are left untouched.
(underive tag parent)
Like clojure.core/underive but scoped on our ex-info type hierarchy
Like clojure.core/underive but scoped on our ex-info type hierarchy
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close