diff options
-rw-r--r-- | lib/lib.clj | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/lib.clj b/lib/lib.clj index 0e07099d..98bd8de8 100644 --- a/lib/lib.clj +++ b/lib/lib.clj @@ -181,7 +181,14 @@ "Throws an exception with a message if pred is true. See java.util.Formatter for format string syntax." [pred fmt & args] - (when pred (throw (Exception. (apply format fmt args))))) + (when pred + (let [message (apply format fmt args) + exception (Exception. message) + raw-trace (.getStackTrace exception) + boring? #(not= (.getMethodName %) "doInvoke") + trace (into-array (drop 2 (drop-while boring? raw-trace)))] + (.setStackTrace exception trace) + (throw exception)))) (def find-resource) ; forward declaration (def load-resource) ; forward declaration |