(collect-results-map xs)
Inputs: [xs :- [s/Any]] Returns: dm-schema/GroupedResults
Separate out errors and result from a vector argument and return them in a map.
Inputs: [xs :- [s/Any]] Returns: dm-schema/GroupedResults Separate out errors and result from a vector argument and return them in a map.
(handle-errors handler {:keys [errors result]})
Inputs: [handler :- (s/=> (s/named (s/eq nil) (quote Unit)) [s/Any]) {:keys [errors result]} :- dm-schema/GroupedResults] Returns: [s/Any]
After using collect-results-map
to group values, this function will handle the errors
portion using handler
(which only produces side effects) and returns only the result
.
Inputs: [handler :- (s/=> (s/named (s/eq nil) (quote Unit)) [s/Any]) {:keys [errors result]} :- dm-schema/GroupedResults] Returns: [s/Any] After using `collect-results-map` to group values, this function will handle the `errors` portion using `handler` (which only produces side effects) and returns only the `result`.
(on-error error-fn result)
Only apply error-fn
to an error result
(one marked with the appropriate keyword).
Only apply `error-fn` to an error `result` (one marked with the appropriate keyword).
(on-error-and-success error-fn success-fn result)
Apply error-fn
if the result
is an error, and otherwise apply success-fn
.
Unlike resolve
, this leaves an error as an error.
Apply `error-fn` if the `result` is an error, and otherwise apply `success-fn`. Unlike `resolve`, this leaves an error as an error.
(on-success success-fn result)
Only apply success-fn
to a successful (i.e. unmarked) result
.
Only apply `success-fn` to a successful (i.e. unmarked) `result`.
(resolve error-fn success-fn result)
Apply error-fn
to the error value if result
is an error, otherwise apply success-fn
.
Unlike on-error-and-success
, this will allow the user to transform an error into a success.
Apply `error-fn` to the error value if `result` is an error, otherwise apply `success-fn`. Unlike `on-error-and-success`, this will allow the user to transform an error into a success.
(try-catch* thunk)
Inputs: [thunk :- (s/=> s/Any)]
Function version of a try-catch block. The body must be provided as a thunk to delay processing.
Macro version in danger-mouse.macros#try-catch
.
Inputs: [thunk :- (s/=> s/Any)] Function version of a try-catch block. The body must be provided as a thunk to delay processing. Macro version in `danger-mouse.macros#try-catch`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close