Skip to content

Instantly share code, notes, and snippets.

@youngnh
Created April 7, 2011 14:28
Show Gist options
  • Save youngnh/907860 to your computer and use it in GitHub Desktop.
Save youngnh/907860 to your computer and use it in GitHub Desktop.
Quick test for Exception causes in wrap-stacktrace
(use 'ring.middleware.stacktrace)
(defn buggy [_]
(throw (Exception. "splork")))
(defn roachy [req]
(try
(buggy req)
(catch Exception e
(throw (Exception. "splunch" e)))))
(defn lousy [req]
(try
(roachy req)
(catch Exception e
(throw (Exception. "kasplow" e)))))
(let [app (wrap-stacktrace lousy)
resp (app {})]
(spit "stacktrace.html" (:body resp)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment