Skip to content

@mmcgrana /trace_results.txt
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
~/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})}
(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)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.