Modify the trace mode initialization code to handle the case where we throw during the processing of the trace data. This should not only return to a non-shimmed state (as it does today) but should also return something useful to the user.
The basic idea is that we make a globally accessible function call that after a crash will give the notebook user the (incomplete) trace result object that would have been returned from their verb. This function might be the current get_trace but the initialization and destruction of the TraceResult object in normal and crash cases will have to be worked out, since that is the current global accessor, and it needs to return None when no trace is in flight. It might be cleaner to have a separate function and global for "we crashed, here is the trace" or we might be able to get by with some state information stored on the TraceResult object.
Once we have that global access, we need to note the exception from the crashing hyrax code with some instructions for accessing the data trace. We should probably use the e.note() api in Python and do so on the verb decorator's general crash handler in the trace subsystem.
The desired end state is that if the user issues a verb ( like h.train(trace=3)) and the invocation crashes, they will get both the python traceback in their notebook just as they normally would, plus an additional note that tells them what to run in their next notebook cell to retrieve and interrogate the TraceResult object that was built up during the crashing run.
Modify the trace mode initialization code to handle the case where we throw during the processing of the trace data. This should not only return to a non-shimmed state (as it does today) but should also return something useful to the user.
The basic idea is that we make a globally accessible function call that after a crash will give the notebook user the (incomplete) trace result object that would have been returned from their verb. This function might be the current
get_tracebut the initialization and destruction of the TraceResult object in normal and crash cases will have to be worked out, since that is the current global accessor, and it needs to return None when no trace is in flight. It might be cleaner to have a separate function and global for "we crashed, here is the trace" or we might be able to get by with some state information stored on the TraceResult object.Once we have that global access, we need to note the exception from the crashing hyrax code with some instructions for accessing the data trace. We should probably use the
e.note()api in Python and do so on the verb decorator's general crash handler in the trace subsystem.The desired end state is that if the user issues a verb ( like
h.train(trace=3)) and the invocation crashes, they will get both the python traceback in their notebook just as they normally would, plus an additional note that tells them what to run in their next notebook cell to retrieve and interrogate the TraceResult object that was built up during the crashing run.