This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-03
Channels
- # announcements (3)
- # asami (4)
- # aws (1)
- # babashka (22)
- # beginners (111)
- # calva (3)
- # cider (1)
- # clj-kondo (55)
- # clj-on-windows (9)
- # cljsrn (1)
- # clojure (13)
- # clojure-europe (35)
- # clojure-losangeles (3)
- # clojure-nl (2)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (5)
- # clojurescript (51)
- # conjure (5)
- # cursive (5)
- # datascript (1)
- # datomic (27)
- # deps-new (8)
- # depstar (41)
- # emacs (4)
- # fulcro (24)
- # graphql (4)
- # gratitude (8)
- # helix (36)
- # jobs (2)
- # leiningen (2)
- # lsp (11)
- # off-topic (24)
- # pathom (23)
- # pedestal (2)
- # polylith (27)
- # re-frame (12)
- # reagent (7)
- # reitit (1)
- # releases (3)
- # remote-jobs (1)
- # rewrite-clj (4)
- # sci (1)
- # shadow-cljs (27)
- # spacemacs (12)
- # tools-deps (31)
- # web-security (2)
Is there a way to get clojure to print more of the stack when the REPL fails to startup? I'm getting "... 38 more" just before the interesting bit! Can I print out the whole thing somehow?
I've actually figured out my the problem now. As usual, as soon as I have up and asked about it I spotted it. But still would be useful/ interesting to know for future. 🙂
when a repl fails startup, that is almost always because your tools told the repl to pre-load a namespace that was broken
if you still have a repl prompt after the error you can use (require 'my.ns :reload-all)
to get the error again, and *e
will hold the detailed error object
you can then edit your code, and repeatedly require / reload the apropriate namespaces until everything loads correctly, without restarting the repl itself
as a last resort (eg. if you can't even get a repl prompt) you can start clojure.main
, the -main
in that ns gives you a very bare bones clojure repl that you can do your require / reload in until things are fixed (you might not even be able to use arrow keys to edit though...)
https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-- discusses the "... 38 more" kind of thing, which is feature of printStactrace, so other mechanisms of viewing the stacktrace won't have it. But the elided lines are only removed because they are dupes
Thanks @hiredman. That looks useful!!