Created
April 7, 2011 14:28
-
-
Save youngnh/907860 to your computer and use it in GitHub Desktop.
Quick test for Exception causes in wrap-stacktrace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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