This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-26
Channels
- # announcements (6)
- # aws (5)
- # beginners (42)
- # cider (24)
- # clojure (81)
- # clojure-canada (1)
- # clojure-europe (122)
- # clojured (5)
- # cursive (6)
- # data-science (5)
- # datahike (9)
- # emacs (6)
- # events (2)
- # fulcro (12)
- # helix (4)
- # honeysql (1)
- # jobs-discuss (1)
- # lsp (28)
- # mid-cities-meetup (1)
- # off-topic (31)
- # polylith (13)
- # shadow-cljs (22)
- # spacemacs (8)
- # tools-deps (33)
- # vim (10)
👋 I'm seeing an issue when passing nil
to <
where the printer seems to get caught throwing an NPE and losing any useful stack trace (see the brief discussion starting https://clojurians.slack.com/archives/C03S1KBA2/p1624725785482400).
In summary:
Evaling
(doall (map (partial < 1000) (conj (into [] (range 1000 1002)) nil)))
at a plain REPL gets me
user=>
(doall (map (partial < 1) [1 2 nil]))
Execution error (NullPointerException) at user/eval158 (REPL:1).
null
(note the user/eval158
bit which I think indicates the actual source of the error information)
whereas in CIDER (`CIDER 1.1.1 (Plovdiv)`) whacking M-x cider-eval-last-sexp RET
yields
1. Unhandled java.lang.NullPointerException
(No message)
with the following messages in *Messages*
error in process filter: cider-stacktrace-render-frame: Format specifier doesn’t match argument type
error in process filter: Format specifier doesn’t match argument type
Does this sound like a bug to anyone else? I'm happy to open an Issue if it does.The error message you are posting there is an emacs logged message, not from clojure
There’s a jvm argument to not omit stacktraces on npe. Wondering if you could add that and see
Need to look up how to do that in deps.edn. I'm just in a simple one file project with a deps.edn file and cider jack in.
Well actually this is interesting. I guess the JVM is doing some kind of syslog style exception compression since after a couple of evals I get back to getting No message. There's gotta be an option that disables that feature altogether.
Actually it sounds like maybe I'm just straight up not passing the option down to the JVM.
OOOOK finally got it.
$ cat deps.edn
{:deps
…
:aliases {:dev {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]}}}
Followed by M-0 M-x cider-jack-in RET
and appending :dev
to the CL like
jack-in command: /usr/local/bin/clojure … -M:cider/nrepl:dev
`
finally yields the option in pgrep
$ pgrep -fla java
99854 /usr/bin/java -XX:-OmitStackTraceInFastThrow …
and gets me the full stack trace every time I trigger the exception. Whooooo boy that's fun.