Fork me on GitHub
#cider
<
2016-02-24
>
jan.zy09:02:01

; CIDER 0.10.2 (Java 1.8.0_25, Clojure 1.7.0, nREPL 0.2.12)
user> (try
        (throw (Exception. "dupa"))
        (catch Exception e (.printStackTrace e)))
;; => nil

jan.zy09:02:18

How can I print the stacktrace in repl?

jan.zy09:02:02

user> (try
        (throw (Exception. "dupa"))
        (catch Exception e (println "this works")
               (.printStackTrace e)))
this works
;; => nil

jan.zy09:02:14

looks like stderr is redirected somewhere else

bozhidar09:02:54

I can reproduce your behaviour, but I notice there’s actually not stderr from this method call

bozhidar09:02:02

you can check your nrepl-messages buffer

bozhidar09:02:25

clojure.stacktrace/print-stack-trace works just fine, though

bozhidar09:02:45

@malabarba: this might be some bug in the stderr redirection middleware

jan.zy10:02:47

confirmed clojure.stacktrace/print-stack-trace works

bozhidar10:02:33

still, this is definitely a bug in cider

jan.zy12:02:33

is there any hack around that? how can i redirect stderr to where stdout is printed?

bozhidar15:02:44

there’s no hack

bozhidar15:02:03

maybe disabling it the middleware will fix this, but I’m not sure

bozhidar15:02:06

has to be tested

bozhidar15:02:19

if there’s no output coming from nREPL

bozhidar15:02:41

there’s nothing you can do but find why the output is missing there

malabarba15:02:44

I'm not sure if our stdout middleware even tries to do anything about stderr

malabarba15:02:49

Probably not

malabarba15:02:04

Which would explain why it's left on the server buffer