clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.55k stars 645 forks source link

exception stack #2553

Closed malloc82 closed 5 years ago

malloc82 commented 5 years ago

I'm not sure if this is a bug of either cider or leiningen, or is simply a behavior that is configurable

Expected behavior

When encounter a compilation error, only top level error is printed in the repl, and the rest of the stack should be printed in *cider-error* window e.g.:

data.pct> 
Syntax error compiling at (pct.clj:524:3).
Unable to resolve symbol: debug in this context
data.pct> 

Actual behavior

data.pct> 
Syntax error compiling at (pct.clj:524:3).
Unable to resolve symbol: debug in this context
ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :pprint-fn clojure.pprint/pprint, :print-length 50, :print-level 50, :session 99762f2e-cc5c-4028-813d-f18cb8e958b1, :id 118}
java.lang.NullPointerException

    at clojure.string$replace_first.invokeStatic(string.clj:165)

    at clojure.string$replace_first.invoke(string.clj:138)

    at cider.nrepl.middleware.stacktrace$relative_path.invokeStatic(stacktrace.clj:204)

    at cider.nrepl.middleware.stacktrace$relative_path.invoke(stacktrace.clj:198)

    at cider.nrepl.middleware.stacktrace$extract_location.invokeStatic(stacktrace.clj:219)

    at cider.nrepl.middleware.stacktrace$extract_location.invoke(stacktrace.clj:206)

    at clojure.core$comp$fn__5792.invoke(core.clj:2569)

    at clojure.core$map$fn__5851.invoke(core.clj:2755)

    at clojure.lang.LazySeq.sval(LazySeq.java:42)

    at clojure.lang.LazySeq.seq(LazySeq.java:51)

    at clojure.lang.RT.seq(RT.java:531)

    at clojure.core$seq__5387.invokeStatic(core.clj:137)

    at clojure.core$seq__5387.invoke(core.clj:137)

    at cider.nrepl.middleware.stacktrace$handle_stacktrace.invokeStatic(stacktrace.clj:312)

    at cider.nrepl.middleware.stacktrace$handle_stacktrace.invoke(stacktrace.clj:309)

    at clojure.lang.Var.invoke(Var.java:388)

    at cider.nrepl$wrap_stacktrace$fn__6479.invoke(nrepl.clj:436)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_complete$fn__6371.invoke(nrepl.clj:172)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_ns$fn__6431.invoke(nrepl.clj:308)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at refactor_nrepl.middleware$wrap_refactor$fn__6057.invoke(middleware.clj:214)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_undef$fn__6511.invoke(nrepl.clj:495)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_profile$fn__6447.invoke(nrepl.clj:345)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.middleware.interruptible_eval$interruptible_eval$fn__922.invoke(interruptible_eval.clj:246)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.middleware.load_file$wrap_load_file$fn__959.invoke(load_file.clj:79)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.middleware.session$add_stdin$fn__1039.invoke(session.clj:243)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_pprint$fn__6329.invoke(nrepl.clj:119)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_content_type$fn__6339.invoke(nrepl.clj:139)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_debug$fn__6381.invoke(nrepl.clj:192)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_inspect$fn__6415.invoke(nrepl.clj:255)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_format$fn__6397.invoke(nrepl.clj:222)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_spec$fn__6471.invoke(nrepl.clj:420)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_version$fn__6519.invoke(nrepl.clj:503)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.middleware.pr_values$pr_values$fn__851.invoke(pr_values.clj:69)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_test$fn__6487.invoke(nrepl.clj:446)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_info$fn__6405.invoke(nrepl.clj:236)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_resource$fn__6463.invoke(nrepl.clj:408)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_enlighten$fn__6389.invoke(nrepl.clj:218)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_trace$fn__6495.invoke(nrepl.clj:466)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_refresh$fn__6455.invoke(nrepl.clj:382)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl.middleware.pprint$handle_pprint_fn.invokeStatic(pprint.clj:61)

    at cider.nrepl.middleware.pprint$handle_pprint_fn.invoke(pprint.clj:56)

    at clojure.lang.Var.invoke(Var.java:388)

    at cider.nrepl$wrap_pprint_fn$fn__6319.invoke(nrepl.clj:100)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_tracker$fn__6503.invoke(nrepl.clj:484)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at cider.nrepl$wrap_out$fn__6439.invoke(nrepl.clj:336)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.middleware.session$session$fn__1024.invoke(session.clj:197)

    at nrepl.middleware$wrap_conj_descriptor$fn__593.invoke(middleware.clj:17)

    at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)

    at nrepl.server$handle_STAR_.invoke(server.clj:15)

    at nrepl.server$handle$fn__1061.invoke(server.clj:27)

    at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)

    at clojure.lang.AFn.call(AFn.java:18)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    at java.lang.Thread.run(Thread.java:748)

data.pct> 

Steps to reproduce the problem

(defn test
  []
  (println a) ;; Unable to resolve symbol: a in this context
  (throw (Exception. "test exception")))

Environment & Version information

clojure 1.10.0 (when using 1.9, the behavior is correct, I guess it's something to do with the new datafy api?) java 1.8.0_181-b13

CIDER version information

cider-0.19.0 SNAPSHOT (20181223.711)

Warning: implicit middleware found: refactor-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
nREPL server started on port 8000 on host 127.0.0.1 - nrepl://127.0.0.1:8000
REPL-y 0.4.3, nREPL 0.5.3
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_181-b13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

Lein/Boot version

leiningen 2.8.3

Emacs version

emacs 26.1

Operating system

Mac & Linux

bbatsov commented 5 years ago

What's your CIDER version?

malloc82 commented 5 years ago

melpha 20181223.711

malloc82 commented 5 years ago

sorry, the emacs package does not have commit version after the package is installed, but it's most likely this: 4e402d0bc3c274b077285039e1eb238d275c19c3

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] commented 5 years ago

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.