Skip to content

Instantly share code, notes, and snippets.

@cark
Created January 13, 2010 16:36
Show Gist options
  • Save cark/276336 to your computer and use it in GitHub Desktop.
Save cark/276336 to your computer and use it in GitHub Desktop.
(defmacro safe-agent [& body]
`(try
~@body
(catch Exception e#
(log [:agent :error] {:exception (str e#)
:agent (with-out-str (pr @*agent*))})
@*agent*)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment