Skip to content

Instantly share code, notes, and snippets.

@slagyr
Last active January 9, 2019 23:44
Show Gist options
  • Save slagyr/42c06f51d9faafe2fc58 to your computer and use it in GitHub Desktop.
Save slagyr/42c06f51d9faafe2fc58 to your computer and use it in GitHub Desktop.
asyn exceptions
(ns slagyr.async)
(den foo []
(js/setTimeout
(fn [] (throw (js/Error. "foo")))
100))
(try
(foo)
(catch js/Object e
(println "Got it! " e)))
; try on http://cljsfiddle.net/
; Exception is thrown in parent context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment