Skip to content

Instantly share code, notes, and snippets.

@steveshogren
Last active December 21, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveshogren/6256803 to your computer and use it in GitHub Desktop.
Save steveshogren/6256803 to your computer and use it in GitHub Desktop.
;; trace-forms "Trace all the forms in the given body. Returns any
;; underlying uncaught exceptions that may make the forms fail."
(trace-forms
(let [a (+ 1 1)
b (* 2 2)
c (* a b (/ 4 0))]
c))
;; => ArithmeticException Divide by zero
;; Form failed: (/ 4 0)
;; Form failed: (* a b (/ 4 0))
;; Form failed: (let* [a (+ 1 1) b (* 2 2) c (* a b (/ 4 0))] c)
;; Form failed: (let [a (+ 1 1) b (* 2 2) c (* a b (/ 4 0))] c)
;; clojure.lang.Numbers.divide (Numbers.java:156)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment