(map->CatchHandler m__7585__auto__)
Factory function for class clojure.core.async.impl.ioc_macros.CatchHandler, taking a map of keywords to field values.
Source
(defrecord CatchHandler [catches]
IInstruction
(reads-from [this] [])
(writes-to [this] [])
(block-references [this] (map first catches))
ITerminator
(terminate-block [this state-sym _]
(let [ex (gensym 'ex)]
`(let [~ex (aget-object ~state-sym ~VALUE-IDX)]
(aset-all! ~state-sym ~CURRENT-EXCEPTION ~ex)
(cond
~@(for [[handler-idx type] catches
i [`(instance? ~type ~ex) ` (aset-all! ~state-sym
~STATE-IDX ~handler-idx
~CURRENT-EXCEPTION nil)]]
i)
:else (throw ~ex))
:recur))))