New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stderr not sent back to client #28
Comments
Hey @tzzh, thanks for the issue. We have tests for normal output here: https://github.com/babashka/babashka.nrepl/blob/master/test/babashka/nrepl/server_test.clj#L213-L230 It should not be too hard to support the same for |
Hey, so I realised when running this code that #error {
:cause class sci.impl.vars.SciUnbound cannot be cast to class java.io.Writer (sci.impl.vars.SciUnbound is in unnamed module of loader 'app'; java.io.Writer is in module java.base of loader 'bootstrap')
:via
[{:type clojure.lang.ExceptionInfo
:message class sci.impl.vars.SciUnbound cannot be cast to class java.io.Writer (sci.impl.vars.SciUnbound is in unnamed module of loader 'app'; java.io.Writer is in module java.base of loader 'bootstrap') [at line 1, column 1]
:data {:type :sci/error, :line 1, :column 1, :message class sci.impl.vars.SciUnbound cannot be cast to class java.io.Writer (sci.impl.vars.SciUnbound is in unnamed module of loader 'app'; java.io.Writer is in module java.base of loader 'bootstrap') [at line 1, column 1]} so then in babashka.nrepl/src/babashka/nrepl/impl/server.clj Lines 31 to 32 in 3e97bcb
I am not sure how to get the right print writer I tried sci/err pw but then it sends stderr to stdout and I am not sure how I can bind sci/err to the right writer
|
@tzzh I think you need to build another replying-print-writer that sends "err" messages instead of "out" messages:
and bind that to I think it's nicer to make |
OK cool I am not super familiar with the nrepl code but I am starting to understand thanks 👍 - I'll try and make a PR for this |
@tzzh The pod protocol was largely inspired by nREPL so you're probably more familiar than you realize :). |
Thanks! |
When running
bb --nrepl-server
and the connecting to it with a nrpel client for examplelein repl :connect 1667
, stderr is not visible in the client, for example the following doesn't print anythingThe text was updated successfully, but these errors were encountered: