Fork me on GitHub
#reveal
<
2022-03-10
>
aratare15:03:53

Hi there, I'm just starting out with Reveal and so far I've been very impressed with it, so thank you for the wonderful tool 🙂 I did, however, come across something which I'm not sure if it's by design or not: For a Cursive project that I'm working on, I noticed that if I send a form that may result in some exception being thrown, to the contrary of my expectation, nothing is shown in Reveal. This has cost me a few hours to debug until I opened up the Cursive REPL window and saw everything being printed correctly. Is this behaviour by design? If not, is there any way I can reroute all the exception messages to Reveal, or better yet, reroute everything to Reveal? Thanks in advance.

vlaaad21:03:34

Hi, thanks for your kind words! Can you show how it looks? Built-in reveal repls show thrown exceptions in the output... Is the exception thrown on a different thread that does not have *out* binding forwarded from the REPL? Do you use nrepl?

aratare04:03:12

Ah sorry I think I've made a mistake. Sending forms to the REPL works fine with everything printed correctly. But if I use my frontend to send a request which triggers the same form, then all the messages won't be printed out correctly.

aratare04:03:26

Here's a screenshot. Please ignore the empty space on the left.

vlaaad08:03:05

Ah, this one is tricky because it happens on the different thread that does not forward *out* bindings. The solution to this is overriding System/out and System/err, which is hard to do because it's a global mutable state that can't be localized. This means, for example, that you can't start 2 reveal REPLs in the process and make them both receive all System/{out,err} output.

vlaaad08:03:25

OTOH I clearly see the usefulness and thought about adding this, but so far I don't have an understanding of how to do that in a non-intrusive way

aratare08:03:02

Ah that's a shame. Yeah I can see how this may be a bit tricky to implement. I guess for the time being I'll keep Cursive REPL as secondary. Thanks a lot for the help 😄