Liking cljdoc? Tell your friends :D

s-exp.ex


ancestorsclj/s

(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
raw docstring

catchclj/s

(catch 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.
raw docstring

deriveclj/s

(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
raw docstring

descendantsclj/s

(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
raw docstring

ex-busyclj/s≠

clj
(ex-busy msg)
(ex-busy msg data)
(ex-busy msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/busy. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/busy`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-busy!clj/s≠

clj
(ex-busy! msg)
(ex-busy! msg data)
(ex-busy! msg data cause)

Builds an exception with ex-busy and throws it.

Builds an exception with ex-busy and throws it.
cljs
raw docstring

ex-conflictclj/s≠

clj
(ex-conflict msg)
(ex-conflict msg data)
(ex-conflict msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/conflict. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/conflict`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-conflict!clj/s≠

clj
(ex-conflict! msg)
(ex-conflict! msg data)
(ex-conflict! msg data cause)

Builds an exception with ex-conflict and throws it.

Builds an exception with ex-conflict and throws it.
cljs
raw docstring

ex-faultclj/s≠

clj
(ex-fault msg)
(ex-fault msg data)
(ex-fault msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/fault. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/fault`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-fault!clj/s≠

clj
(ex-fault! msg)
(ex-fault! msg data)
(ex-fault! msg data cause)

Builds an exception with ex-fault and throws it.

Builds an exception with ex-fault and throws it.
cljs
raw docstring

ex-forbiddenclj/s≠

clj
(ex-forbidden msg)
(ex-forbidden msg data)
(ex-forbidden msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/forbidden. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/forbidden`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-forbidden!clj/s≠

clj
(ex-forbidden! msg)
(ex-forbidden! msg data)
(ex-forbidden! msg data cause)

Builds an exception with ex-forbidden and throws it.

Builds an exception with ex-forbidden and throws it.
cljs
raw docstring

ex-incorrectclj/s≠

clj
(ex-incorrect msg)
(ex-incorrect msg data)
(ex-incorrect msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/incorrect. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/incorrect`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-incorrect!clj/s≠

clj
(ex-incorrect! msg)
(ex-incorrect! msg data)
(ex-incorrect! msg data cause)

Builds an exception with ex-incorrect and throws it.

Builds an exception with ex-incorrect and throws it.
cljs
raw docstring

ex-infoclj/s

(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 a keyword

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 a keyword
raw docstring

ex-interruptedclj/s≠

clj
(ex-interrupted msg)
(ex-interrupted msg data)
(ex-interrupted msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/interrupted. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/interrupted`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-interrupted!clj/s≠

clj
(ex-interrupted! msg)
(ex-interrupted! msg data)
(ex-interrupted! msg data cause)

Builds an exception with ex-interrupted and throws it.

Builds an exception with ex-interrupted and throws it.
cljs
raw docstring

ex-not-foundclj/s≠

clj
(ex-not-found msg)
(ex-not-found msg data)
(ex-not-found msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/not-found. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/not-found`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-not-found!clj/s≠

clj
(ex-not-found! msg)
(ex-not-found! msg data)
(ex-not-found! msg data cause)

Builds an exception with ex-not-found and throws it.

Builds an exception with ex-not-found and throws it.
cljs
raw docstring

ex-typeclj/s

(ex-type ex)

Returns the type of the ex-info if possible

Returns the `type` of the ex-info if possible
raw docstring

ex-unavailableclj/s≠

clj
(ex-unavailable msg)
(ex-unavailable msg data)
(ex-unavailable msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/unavailable. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/unavailable`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-unavailable!clj/s≠

clj
(ex-unavailable! msg)
(ex-unavailable! msg data)
(ex-unavailable! msg data cause)

Builds an exception with ex-unavailable and throws it.

Builds an exception with ex-unavailable and throws it.
cljs
raw docstring

ex-unsupportedclj/s≠

clj
(ex-unsupported msg)
(ex-unsupported msg data)
(ex-unsupported msg data cause)

Returns an ex-info with ex-data :type set to :s-exp.ex/unsupported. Rest of the arguments match ex-info

Returns an ex-info with ex-data `:type` set to `:s-exp.ex/unsupported`. Rest of the arguments match `ex-info`
cljs
raw docstring

ex-unsupported!clj/s≠

clj
(ex-unsupported! msg)
(ex-unsupported! msg data)
(ex-unsupported! msg data cause)

Builds an exception with ex-unsupported and throws it.

Builds an exception with ex-unsupported and throws it.
cljs
raw docstring

gen-all-ex-fns!clj/smacro

(gen-all-ex-fns!)

hierarchyclj/s


isa?clj/s

(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
raw docstring

parentsclj/s

(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
raw docstring

try+clj/smacro

(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 :s-exp.ex/type key (or just :type), 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 ::something my-ex-data (do-something my-ex-info)) (catch ::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 :s-exp.ex/type key (or just :type), 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 ::something my-ex-data
    (do-something my-ex-info))
  (catch ::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.
raw docstring

typeclj/s

(type d)

Returns type value from ex-data map (not the ex-info instance, use ex-type for this

Returns `type` value from ex-data map (not the ex-info instance, use
`ex-type` for this
raw docstring

type?clj/s

(type? ex t)

Returns true if ex is an ex-info with descendant/type of type

Returns true if `ex` is an ex-info with descendant/type of `type`
raw docstring

typesclj/s


underiveclj/s

(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
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close