Created
November 4, 2014 03:46
-
-
Save thirdreplicator/0167625df3ac4af67a58 to your computer and use it in GitHub Desktop.
try-catch macro clojure
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
(defn add-line-breaks [string-seq] | |
(->> string-seq | |
(interpose "\n") | |
clojure.string/join)) | |
(defmacro record-error [& body] | |
`(try ~@body (catch Throwable t# | |
(add-line-breaks (map str (.getStackTrace t#)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment