(catch x error-handler)
(catch x error-class error-handler)
An equivalent of the catch clause, which takes an error-handler
function that will be invoked
with the exception, and whose return value will be yielded as a successful outcome. If an
error-class
is specified, only exceptions of that type will be caught. If not, all exceptions
will be caught.
(-> d
(chain f g h)
(catch :invalid #(str "caught Exception info with data: " %)
(catch IOException #(str "oh no, IO: " (.getMessage %)))
(catch #(str "something unexpected: " (.getMessage %))))
An equivalent of the catch clause, which takes an `error-handler` function that will be invoked with the exception, and whose return value will be yielded as a successful outcome. If an `error-class` is specified, only exceptions of that type will be caught. If not, all exceptions will be caught. (-> d (chain f g h) (catch :invalid #(str "caught Exception info with data: " %) (catch IOException #(str "oh no, IO: " (.getMessage %))) (catch #(str "something unexpected: " (.getMessage %))))
(catch' x error-handler)
(catch' x error-pattern error-handler)
Like catch
, but does not coerce deferrable values.
Like `catch`, but does not coerce deferrable values.
(zipseq vals)
Takes a collection of values, some of which may be deferrable, and returns a deferred that will yield a list of realized values. @(zipseq [1 2 3]) => [1 2 3] @(zipseq [(future 1) 2 3]) => [1 2 3]
Takes a collection of values, some of which may be deferrable, and returns a deferred that will yield a list of realized values. @(zipseq [1 2 3]) => [1 2 3] @(zipseq [(future 1) 2 3]) => [1 2 3]
(zipseq' vals)
Like zipseq
, but only unwraps Manifold deferreds.
Like `zipseq`, but only unwraps Manifold deferreds.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close