Add `logged-future`

This commit is contained in:
Peter Taoussanis 2013-02-06 00:37:12 +07:00
parent 6c359427d9
commit 9454e0f4ab
1 changed files with 4 additions and 1 deletions

View File

@ -367,8 +367,11 @@
(defmacro log-and-rethrow-errors
[& body] `(try ~@body (catch Exception e# (error e#) (throw e#))))
(defmacro logged-future [& body] `(future (log-errors ~@body)))
(comment (log-errors (/ 0))
(log-and-rethrow-errors (/ 0)))
(log-and-rethrow-errors (/ 0))
(logged-future (/ 0)))
;;;; Dev/tests