day8 / re-frame-debux

A fork of debux for tracing re-frame code (for eventual consumption by re-frame-10x)
Eclipse Public License 1.0
43 stars 7 forks source link

Send exceptions to 10x #34

Open stumitchell opened 4 years ago

stumitchell commented 4 years ago

Currently in re-frame-10x when a traced event handlers raises an exception there is no visual indication of this disaster shown in the Events panel (apart from half of the trace missing because the execution was prematurely halted). Screenshot 2020-07-17 at 14 34 33

If the exception is shown the trace screen would be a fantastic help to determine what went wrong as it would show the values of the fragments that lead up to the error.

I suggest that the form that caused the exception should be traced and displayed in red in 10x. The value of that form should be the error and it should be displayed somewhere by default.

See https://github.com/day8/re-frame-10x/issues/273

To enable this we will need to send exception information as well as result to 10x when we use send-trace! or perhaps we need another function send-exception!. To do this the dbgn macro will need to be changed so that exceptions are caught and sent to re-frame.trace

However, there is a counter argument that if we catch errors it will not allow the workflow where the programmer wishes to use chrome dev tools to break on the error and bring them to the offending code. So perhaps we need a way to turn off this behavior easily.