I opened https://ask.clojure.org/index.php/14648/tools-build-compile-clj-capture-out-err but thought I'd share here in case others have run into this. I have a failing b/compile-clj call which throws the exception "Clojure compilation failed, working dir preserved: ...". This is helpful to see the contents of the call but not super helpful with knowing exactly what went wrong. Given that the process/process call can redirect to :out and :err (as provided by the user), I would find it helpful for debugging to get the contents of those in the ex-data of the thrown exception.
do i need a test for this? i'm not sure how to write one lol
nah
updated the ticket, added a patch
pushed and released as 0.10.10
thx!
yo! thank you!
thank you!
aren't stdout and stderr inherited and printed already?
in normal usage from cli, I think you'll see compile errors and stuff. is that how you're using it or some other way?
re-reading, I see what you're saying, but still curious to know a little more on how you're using it
I'm capturing :out and :err so I can check for Reflection warnings, and if there's no compilation error, this works great. But when there is a compilation error, :out and :err aren't returned.
I could wrap in a try-catch and then call .str on them there, but that feels hacky
makes sense, I can make a jira if you want to send me a patch
actually, I'm writing {:out :capture :err :capture} so I'd first need to pass in my own stringwriter
sure, I can do that
Should only be two lines
probably 3 lines
;