=> (try (/ 1 0) (catch Exception e (str "caught exception: " (.getMessage e)))) "caught exception: Divide by zero"
;; for Clojurescript use js/Object as type (try (/ 1 0) (catch js/Object e (.log js/console e)))
Please see http://clojure.org/special_forms#try
Please see http://clojure.org/special_forms#finally
Please see http://clojure.org/special_forms#throw
Comments top
No comments for try. Log in to add a comment.