public
Last active

  • Download Gist
trace_results.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
~/Desktop $ java -cp clojure-1.3.0-alpha2.jar:clj-stacktrace-0.2.0.jar clojure.main trace_test.clj
== java
java.lang.Exception: I regret to inform you that you are doing it wrong.
at user$biz.invoke(trace_test.clj:8)
at user$bat$f__104.invoke(trace_test.clj:12)
at user$bat.invoke(trace_test.clj:13)
at user$bar.invoke(trace_test.clj:17)
at user$foo.invoke(trace_test.clj:22)
at user$eval109.invoke(trace_test.clj:25)
at clojure.lang.Compiler.eval(Compiler.java:6168)
at clojure.lang.Compiler.load(Compiler.java:6601)
at clojure.lang.Compiler.loadFile(Compiler.java:6564)
at clojure.main$load_script.invoke(main.clj:216)
at clojure.main$script_opt.invoke(main.clj:276)
at clojure.main$main.doInvoke(main.clj:360)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.lang.Var.invoke(Var.java:401)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
 
== clojure.stacktrace
java.lang.Exception: I regret to inform you that you are doing it wrong.
at user$biz.invoke (trace_test.clj:8)
user$bat$f__104.invoke (trace_test.clj:12)
user$bat.invoke (trace_test.clj:13)
user$bar.invoke (trace_test.clj:17)
user$foo.invoke (trace_test.clj:22)
user$eval109.invoke (trace_test.clj:25)
clojure.lang.Compiler.eval (Compiler.java:6168)
clojure.lang.Compiler.load (Compiler.java:6601)
clojure.lang.Compiler.loadFile (Compiler.java:6564)
clojure.main$load_script.invoke (main.clj:216)
clojure.main$script_opt.invoke (main.clj:276)
clojure.main$main.doInvoke (main.clj:360)
clojure.lang.RestFn.invoke (RestFn.java:409)
clojure.lang.Var.invoke (Var.java:401)
clojure.lang.AFn.applyToHelper (AFn.java:163)
clojure.lang.Var.applyTo (Var.java:518)
clojure.main.main (main.java:37)
 
== clojure.repl
Exception I regret to inform you that you are doing it wrong.
user/biz (trace_test.clj:8)
user/bat/f--104 (trace_test.clj:12)
user/bat (trace_test.clj:13)
user/bar (trace_test.clj:17)
user/foo (trace_test.clj:22)
user/eval109 (trace_test.clj:25)
clojure.lang.Compiler.eval (Compiler.java:6168)
clojure.lang.Compiler.load (Compiler.java:6601)
clojure.lang.Compiler.loadFile (Compiler.java:6564)
clojure.main/load-script (main.clj:216)
clojure.main/script-opt (main.clj:276)
clojure.main/main (main.clj:360)
 
== clj-stacktrace.repl
I regret to inform you that you are doing it wrong.
trace_test.clj:8 user/biz
trace_test.clj:12 user/bat[fn]
trace_test.clj:13 user/bat
trace_test.clj:17 user/bar
trace_test.clj:22 user/foo
trace_test.clj:25 user/eval109
Compiler.java:6168 clojure.lang.Compiler.eval
Compiler.java:6601 clojure.lang.Compiler.load
Compiler.java:6564 clojure.lang.Compiler.loadFile
main.clj:216 clojure.main/load-script
main.clj:276 clojure.main/script-opt
main.clj:360 clojure.main/main
RestFn.java:409 clojure.lang.RestFn.invoke
Var.java:401 clojure.lang.Var.invoke
AFn.java:163 clojure.lang.AFn.applyToHelper
Var.java:518 clojure.lang.Var.applyTo
main.java:37 clojure.main.main
 
== clj-stacktrace.core
{:class java.lang.Exception,
:message "I regret to inform you that you are doing it wrong.",
:trace-elems
({:annon-fn false,
:fn "biz",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 8}
{:annon-fn true,
:fn "bat",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 12}
{:annon-fn false,
:fn "bat",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 13}
{:annon-fn false,
:fn "bar",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 17}
{:annon-fn false,
:fn "foo",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 22}
{:annon-fn false,
:fn "eval109",
:ns "user",
:clojure true,
:file "trace_test.clj",
:line 25}
{:method "eval",
:class "clojure.lang.Compiler",
:java true,
:file "Compiler.java",
:line 6168}
{:method "load",
:class "clojure.lang.Compiler",
:java true,
:file "Compiler.java",
:line 6601}
{:method "loadFile",
:class "clojure.lang.Compiler",
:java true,
:file "Compiler.java",
:line 6564}
{:annon-fn false,
:fn "load-script",
:ns "clojure.main",
:clojure true,
:file "main.clj",
:line 216}
{:annon-fn false,
:fn "script-opt",
:ns "clojure.main",
:clojure true,
:file "main.clj",
:line 276}
{:annon-fn false,
:fn "main",
:ns "clojure.main",
:clojure true,
:file "main.clj",
:line 360}
{:method "invoke",
:class "clojure.lang.RestFn",
:java true,
:file "RestFn.java",
:line 409}
{:method "invoke",
:class "clojure.lang.Var",
:java true,
:file "Var.java",
:line 401}
{:method "applyToHelper",
:class "clojure.lang.AFn",
:java true,
:file "AFn.java",
:line 163}
{:method "applyTo",
:class "clojure.lang.Var",
:java true,
:file "Var.java",
:line 518}
{:method "main",
:class "clojure.main",
:java true,
:file "main.java",
:line 37})}
trace_test.clj
Clojure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
(require 'clojure.stacktrace)
(require 'clojure.repl)
(require 'clj-stacktrace.repl)
 
(require 'clj-stacktrace.core)
(require 'clojure.pprint)
 
(defn biz []
(throw (Exception. "I regret to inform you that you are doing it wrong.")))
 
(defn bat []
(let [f (fn [] (biz))]
(f)))
 
(defn bar []
(try
(bat)
(catch Exception e
(throw e))))
 
(defn foo []
(bar))
 
(try
(foo)
(catch Exception e
(println "== java")
(.printStackTrace e)
(println)
(println "== clojure.stacktrace")
(clojure.stacktrace/print-stack-trace e)
(println)
(println "== clojure.repl")
(clojure.repl/pst e)
(println)
(println "== clj-stacktrace.repl")
(clj-stacktrace.repl/pst e)
(println)
(println "== clj-stacktrace.core")
(clojure.pprint/pprint (clj-stacktrace.core/parse-exception e))))
(try (throw (Exception. "fail")) (catch Exception e (println "error:" e)))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.