This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-23
Channels
- # beginners (27)
- # boot (8)
- # cider (17)
- # cljs-dev (8)
- # cljsrn (5)
- # clojure (56)
- # clojure-dev (34)
- # clojure-gamedev (4)
- # clojure-italy (32)
- # clojure-nl (22)
- # clojure-poland (3)
- # clojure-russia (17)
- # clojure-spec (31)
- # clojure-uk (48)
- # clojurescript (47)
- # core-async (41)
- # cursive (13)
- # datomic (22)
- # emacs (9)
- # figwheel (7)
- # fulcro (18)
- # graphql (3)
- # hoplon (15)
- # jobs-discuss (38)
- # keechma (1)
- # luminus (10)
- # off-topic (42)
- # onyx (8)
- # overtone (3)
- # protorepl (5)
- # re-frame (42)
- # reagent (6)
- # reitit (3)
- # schema (4)
- # shadow-cljs (39)
- # slack-help (5)
- # spacemacs (8)
- # specter (1)
- # tools-deps (36)
- # uncomplicate (9)
- # vim (34)
Is there any way to get cider to show (.printStackTrace error)
's result in other threads as a normal stacktrace?
I don't like having to look at the repl to see the error.
I’ve not been able to see logs in cider. This is using cider-nrepl
0.17.0-SNAPSHOT
. My application is logging to STDOUT. There’s no *nrepl-server*
buffer or anything similar. How might I go about debugging this? I know that the application is logging correctly. The logs show up when I run code in the Cursive REPL.
Note that I’m quite ignorant when it comes to emacs things.
Side by side, is there a way to tell cider not to use SNAPSHOT
versions of cider-nrepl
?
@ghopper I’m not sure I’m understanding the problem you have and what you want to achieve.
@jysandy Generally such logs end up in the nrepl-server buffer and should also be doubled in your REPL. Are you on the most recent snapshot?
Well, if you don’t use snapshot versions of cider-nrepl
with a snapshot version of CIDER, it’s not going to work. 🙂 You can always use some repo like melpa-stable
and the latest stable release instead.
@bozhidar Cider only handles errors that are bubbled up to the main thread (I assume this has something to do with the way the nrepl middleware is setup.) Is there a way to get it to handle/pretty-print stacktraces that are printed from other threads? Unfortunately there isn't a good way for me to get the errors to be thrown on the main thread, so I have to resort to (try ... (catch Exception e (.printStackTrace e)))
at the moment.
I can't think of a way right now, but I could think of some magical ways to do it... :thinking_face:
Haha, if you've got some wizardry that'd be cool. It's really only a problem, because I'm diving into the messy world of ugly java libraries.
a minimumly viable way to do it: (catch Exception e (def crap-an-error e))
(or use an atom or something mutable) and then from the repl, just do (throw crap-an-error)
Oh, catch errors and set them in a watched atom or something is an idea.
A tag?
presumably something similar to the #dbg
and the like used in https://github.com/clojure-emacs/cider/blob/master/doc/debugging.md#debugging
but I'm just guessing
Thanks for the suggestion, @tanzoniteblack. I've gone ahead with (catch Exception e (reset! error e))
then I just evaluate #_(throw @error)
when I need to see the error. It's not pretty, but it works alright.