Last active
January 9, 2019 23:44
-
-
Save slagyr/42c06f51d9faafe2fc58 to your computer and use it in GitHub Desktop.
asyn exceptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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