(always-pr & body)wraps body in a promise, even if the body exprs throw during evaluation
wraps body in a promise, even if the body exprs throw during evaluation
(catch error-handler & body)catches any errors and returns the result of applying the error-handler to the error-value
catches any errors and returns the result of applying the error-handler to the error-value
(catch-error body)catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
(catch-handle handlers body)catch-error and handle - any unhandled tags result in an exception
catch-error and handle - any unhandled tags result in an exception
(catch-handle-safe default-response-or-fn body)(catch-handle-safe handlers default-response-or-fn body)catch-error and handle - if a tag is unhandled and a default-response-fn is provided then it will be called with the unhandled variant, if a default response value is provided then a warning will be logged and the default response value will be returned
catch-error and handle - if a tag is unhandled and a default-response-fn is provided then it will be called with the unhandled variant, if a default response value is provided then a warning will be logged and the default response value will be returned
(catch-log description error-handler & body)catches any errors, logs them and returns the result of applying the error-handler to the error-value
catches any errors, logs them and returns the result of applying the error-handler to the error-value
(catch-xform-error error-xform body)catches any errors and returns the results of (error-xform (decode-error-value error-value))
catches any errors and returns the results of (error-xform (decode-error-value error-value))
(dado & body)alet with a deferred or pr-context
alet with a deferred or pr-context
(ddo & body)mlet with a deferred or pr-context
mlet with a deferred or pr-context
(decode-error-value v)decodes an error value to a variant. if the error-value is already a variant, or an ex-info with a variant, it returns that directly, otherwise you will get an [::unknown-error] variant
decodes an error value to a variant. if the error-value is already a variant, or an ex-info with a variant, it returns that directly, otherwise you will get an [::unknown-error] variant
(error-ex [tag value])(error-ex tag value)(error-ex tag value cause)encodes an error-variant on to an ex-info
encodes an error-variant on to an ex-info
(error-pr [tag value])(error-pr tag value)(error-pr tag value cause)creates an errored promise encoding the error-variant
creates an errored promise encoding the error-variant
(exception? v)true if the arg is a platform exception
true if the arg is a platform exception
(factory-pr factory-cb)promesa-style promise creation - the factory-cb callback will receive resolve and reject fns to complete the promise
promesa-style promise creation - the factory-cb callback will receive resolve and reject fns to complete the promise
(finally callback & body)finally for promises - makes sure to run the finally even if promise chain init throws. some exceptions might slip through the net - non-Exception Throwables on the jvm for example - but we are probably in deeper trouble anyway if that happens
finally for promises - makes sure to run the finally even if promise chain init throws. some exceptions might slip through the net - non-Exception Throwables on the jvm for example - but we are probably in deeper trouble anyway if that happens
(handle handlers [tag value])handle a variant
if a handler is not available for the tag then an error-ex with tag ::unhandled-tag will be thrown
handle a variant - handlers : map of tag to handler if a handler is not available for the tag then an error-ex with tag ::unhandled-tag will be thrown
(handle-safe handlers default-response-or-fn [tag value])safely handle a variant
if a handler is not available and a default-response fn is provided it will be called with the unhandled variant, if a default-response value is provided then a warning will be logged for the unhandled variant, and the default response value will be returned
safely handle a variant - handlers : a map of tag to handler if a handler is not available and a default-response fn is provided it will be called with the unhandled variant, if a default-response value is provided then a warning will be logged for the unhandled variant, and the default response value will be returned
(success-pr value)creates a promise containing the value
creates a promise containing the value
(wrap-catch-error body)(wrap-catch-error tag body)wraps any normal responses in a [tag <response>] variant, and catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
wraps any normal responses in a [tag <response>] variant, and catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
(wrap-catch-error-log description body)(wrap-catch-error-log description tag body)wraps any normal responses in a [tag <response>] variant, and catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
wraps any normal responses in a [tag <response>] variant, and catches any errors and returns the results of decode-error-value on the error value. has to be a macro to catch any exceptions in the initial evaluation of the body
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |