Hello all again.
I am trying to find a way for a piece of middleware to access a var bound in the current thread
It seems messages inbound to the nREPL have
:session
bound to an atom containing the bindings. But the message on the way out seems to just have the session id boundThis confuses me, as it seems that it should be the other way around
That session id needs to be on the inbound message, and bound variables put on the transport back
does anyone have any insight into this?
it will depend where in the stack your middleware goes
okay.
Hello again @hiredman.
my
set-descriptor!
call only specifies "eval"
as expectedI wrap the transport of every inbound message to gain access to messages on the way out
https://gist.github.com/UnwarySage/5f6a06c37ba6f39705d8cf76930d2dd9
this is the raw code
at present only updating the error message with a test string
Ideally I would be assoc-ing in the a value derived from the raw exception. (in line 16) IE, I would love to be able to access
*e
Seems to me you want to do something along the lines of https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/error_handling.clj#L172
@bozhidar Ah, I have seen that one before. Please correct me if I am wrong, but is that not dealing with errors thrown by the middleware, not the user code?
Ah, yeah - that’s right. I’m wasn’t quite certain what you’re trying to achieve.
I'm trying to capture error messages thrown from user code, so I can re-write them for simplicity, so that beginning students can use clojure for their first programming language