Permalink
Browse files

add thrown-cause? helper

  • Loading branch information...
1 parent da24804 commit 7059efc34702c03803e43d322cc98fa1e6ed9403 @nathanmarz nathanmarz committed Mar 11, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/clj/backtype/storm/util.clj
@@ -127,6 +127,13 @@
(some (partial instance? klass))
boolean))
+(defmacro thrown-cause? [klass & body]
+ `(try
+ ~@body
+ false
+ (catch Throwable t#
+ (exception-cause? ~klass t#))))
+
(defmacro forcat [[args aseq] & body]
`(mapcat (fn [~args]
~@body)

0 comments on commit 7059efc

Please sign in to comment.