Skip to content

Instantly share code, notes, and snippets.

@ninjudd
Created August 7, 2012 00:15
Show Gist options
  • Select an option

  • Save ninjudd/3279837 to your computer and use it in GitHub Desktop.

Select an option

Save ninjudd/3279837 to your computer and use it in GitHub Desktop.
(defmacro with-error-header
"Execute the code in body, printing the given error message if something goes wrong."
[message & body]
`(try ~@body
(catch Throwable e
(binding [*out* *err*]
(println message))
(throw e))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment