Utility functions for using Promenade effectively
Utility functions for using Promenade effectively
(!se-info expr)
Evaluate given form and return the result; on promenade.util.StacklessExceptionInfo
return the exception as a
thrown context.
See: promenade.core/!
, se-info
, se-info?
, !wrap-se-info
Evaluate given form and return the result; on `promenade.util.StacklessExceptionInfo` return the exception as a thrown context. See: [[promenade.core/!]], [[se-info]], [[se-info?]], [[!wrap-se-info]]
(!wrap-se-info f)
Wrap given function such that on promenade.util.StacklessExceptionInfo
it returns the exception as a thrown
context.
See: promenade.core/!wrap
, se-info
, se-info?
, !se-info
Wrap given function such that on `promenade.util.StacklessExceptionInfo` it returns the exception as a thrown context. See: [[promenade.core/!wrap]], [[se-info]], [[se-info?]], [[!se-info]]
(defailure the-name fields & more)
Define a failure entity and corresponding instance type predicate function.
Define a failure entity and corresponding instance type predicate function.
(defentity the-name)
(defentity the-name fields & more)
Define entity record and corresponding instance type predicate function. If fields are unspecified, assume single
field value
.
Examples:
(defentity ProductCode) ; create record ProductCode with single field 'value', and predicate fn ProductCode?
(defentity Approval [by when]) ; create record Approval with fields `by` and `when`, and predicate Approval?
See: defailure
Define entity record and corresponding instance type predicate function. If fields are unspecified, assume single field `value`. Examples: ``` (defentity ProductCode) ; create record ProductCode with single field 'value', and predicate fn ProductCode? (defentity Approval [by when]) ; create record Approval with fields `by` and `when`, and predicate Approval? ``` See: [[defailure]]
(se-info msg)
(se-info msg data)
Like clojure.core/ex-info
, but with the following differences:
promenade.util/se-info | clojure.core/ex-info , cljs.core/ex-info |
---|---|
no stack trace or cause support | full support for stack trace and cause |
much faster and lightweight | same cost model as regular exceptions |
meant for flow control, not debugging | meant for debugging and flow control |
uses promenade.util.StacklessExceptionInfo | uses (clojure.lang|cljs.core).ExceptionInfo |
You may use clojure.core/ex-data
or cljs.core/ex-data
on this exception to retrieve the data.
See: se-info?
, !se-info
, !wrap-se-info
Like `clojure.core/ex-info`, but with the following differences: | `promenade.util/se-info` | `clojure.core/ex-info`, `cljs.core/ex-info` | |----------------------------------------------|-----------------------------------------------| | no stack trace or cause support | full support for stack trace and cause | | much faster and lightweight | same cost model as regular exceptions | | meant for flow control, not debugging | meant for debugging and flow control | | uses `promenade.util.StacklessExceptionInfo` | uses `(clojure.lang|cljs.core).ExceptionInfo` | You may use `clojure.core/ex-data` or `cljs.core/ex-data` on this exception to retrieve the data. See: [[se-info?]], [[!se-info]], [[!wrap-se-info]]
(se-info? x)
Return true
if argument is an instance of StacklessExceptionInfo
, false
otherwise.
See: se-info
, !se-info
, !wrap-se-info
Return `true` if argument is an instance of `StacklessExceptionInfo`, `false` otherwise. See: [[se-info]], [[!se-info]], [[!wrap-se-info]]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close