Title: Provide debuggers with a way to know that a function is exiting with an unhandled exception.
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, fabioz
Priority: normal Keywords:

Created on 2018-07-11 18:07 by fabioz, last changed 2018-07-11 19:39 by eric.snow.

Messages (1)
msg321492 - (view) Author: Fabio Zadrozny (fabioz) Date: 2018-07-11 18:07
Right now, debuggers can deal with handled exceptions by detecting the 'exception' event, but it's hard to know if the exception is handled or unhandled at that point (so, debuggers end up checking if it happens in a top-level function, but this isn't good if the user started the code and did a remote attach later on, where the top-level code is still user code).

My suggestion would be creating another event type (such as 'exception_return') which would be issued after the 'return' event with the same information passed on the 'exception' info so that debuggers can detect that some exception is unhandled (the 'return' would still be issued as usual to minimize breakage to existing debuggers).

Another option could be adding that information to the frame itself during a 'return' event (and then removing right after calling the debugger to avoid any cycles) -- although I think the other option is better to avoid making the frame bigger.
Date User Action Args
2018-07-11 19:39:46eric.snowsetnosy: + eric.snow
2018-07-11 18:07:01fabiozcreate