From 83fa7099432d5af2febbad9c33e076b9a03c3d1e Mon Sep 17 00:00:00 2001 From: scgilardi Date: Sat, 6 Jun 2009 14:24:26 +0000 Subject: except: support exception classes that don't allow wrapping a cause --- src/clojure/contrib/except.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/clojure/contrib/except.clj b/src/clojure/contrib/except.clj index 8cb98417..93153342 100644 --- a/src/clojure/contrib/except.clj +++ b/src/clojure/contrib/except.clj @@ -81,7 +81,10 @@ formatted using clojure.core/format."} [arg] args [cause & args] (if (throwable? arg) args (cons nil args)) message (when args (apply format args)) - ctor-args (into-array Object [message cause]) + ctor-args (into-array Object + (cond (and message cause) [message cause] + message [message] + cause [cause])) throwable (Reflector/invokeConstructor class ctor-args) our-prefix "clojure.contrib.except$throwable" not-us? #(not (.startsWith (.getClassName %) our-prefix)) -- cgit v1.2.3-18-g5258