Fork me on GitHub
#nrepl
<
2018-02-27
>
hiredman00:02:21

pr-values isn't what turns them in to strings

Charlot00:02:00

@hiredman are you thinking of bencode?

hiredman00:02:29

interruptible-eval does

hiredman00:02:04

it catches exceptions when evaling and sends them back as the error nrepl message with stirng values

hiredman00:02:55

likely the easiest thing to do would be to have your middleware watch for error nrepl messages and then eval *1 to get the error object (before pr-values)

hiredman00:02:14

pr-values only applies to the results of normal execution

Charlot00:02:33

this is invaluable to me.

Charlot00:02:38

Thank you very much

Charlot00:02:50

okay, follow up question. I have never seen a :ex keyword in a response, it's always been a string in :err

Charlot00:02:57

what makes :err

hiredman00:02:59

:err is a message printed to *err* not an exception

hiredman00:02:08

:err is like stderr

hiredman00:02:21

:out is like stdout

Charlot00:02:56

okay, and I have messages coming back with :err, so and no :ex so I did not think it was that simple

hiredman00:02:08

you can generate :errs by (binding [*out* *err*] (println "foo"))

hiredman00:02:35

and running code can do it at anytime without bubbling up an exception anywhere, or even throwing an exception

Charlot00:02:35

yes! this was exactly what I needed. Thank you very much @hiredman