This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-06
Channels
- # announcements (3)
- # babashka (1)
- # beginners (26)
- # calva (1)
- # cider (17)
- # clj-commons (16)
- # clj-kondo (11)
- # clojure (21)
- # clojure-europe (9)
- # clojure-norway (1)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (4)
- # clojurescript (35)
- # datomic (5)
- # emacs (9)
- # figwheel-main (15)
- # fulcro (26)
- # honeysql (1)
- # lsp (5)
- # off-topic (2)
- # polylith (1)
- # rdf (6)
- # re-frame (4)
- # reagent (15)
- # reitit (9)
- # releases (2)
- # shadow-cljs (4)
- # sql (25)
- # squint (2)
- # xtdb (7)
Can core.async go blocks break exception handling?
(defn dispatch-handlers
[handlers event-type event-data & args]
(if-let [f (handlers event-type)]
(doseq [f' f]
(println " " (pr-str f') (fn? f') (fn? @f'))
(apply @f' event-type event-data args)
(println "FIN")) ;; <--- To test if this get's run
(do
(println ":tada: NEW EVENT! :tada:")
(println "Event type:" event-type)
(println "Event data:" (pr-str event-data)))))
So the above code happens within a go block, basically like this:
(try
(dispatch-handlers #'handlers event-type event-data)
(catch Exception e
(log/error e "Exception occurred in event handler.")))
handlers
is basically:
{:handler [#'handler-fn]}
So an exception in handler-fn
just seems to fail silently?I assume it works if try&catch are in its own function?