You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Debugger either breaks on class instantiation instead of in class code or breaks on all raised exceptions while breaking properly in class code. When the debugger breaks on class instantiation only there is no indication of which line actually caused the exception. In a large class this makes debugging in Visual Studio a tedious process of manually stepping through code or pressing continue for each handled exception.
Steps to Reproduce
Disable all Python Exceptions in Exceptions Settings (there is no unhandled exceptions to select in the list).
Run with Debugging. Debugger Breaks on class instantiation with no indication of where the error occurred (line 11)
Exception Details:
Message=name 'j' is not defined
Source=...\Scratch.py
StackTrace:
File "...\Scratch.py", line 14, in
H=h()
3.Enable Python Exceptions (there is no Handled Exceptions option to deselect in the list). Run with Debugging: Breaks on Handled Exception (not wanted behaviour)
4. Continue to next exception. Breaks where the exception actually occurred (wanted behaviour) in the class and then on instantiation after continuing again.
After Continue
Expected behavior
The ability to skip handled exceptions and break in class code not only on instantiation. VSCode for example, by selecting break on uncaught Exceptions only the debugger breaks in the class code and skips the handled exception. In a large class this makes debugging in Visual Studio a tedious process which is why I use the VScode debugger to find bugs in large classes
class H(object):
def init(self):
#unhandled exception
print(j)
if name == "main":
h=H()
This also occurs if the exception is not in init:
Behaviour is not seen when not using classes.
Configuration information (If you are providing a diagnostics file (see below), skip this section)
VS Version: 16.8.0
PTVS version: 16.8.20241.2
Python version:
Debugger Type (if applicable): New debugger, have not tried on Legacy yet
Describe the bug
Debugger either breaks on class instantiation instead of in class code or breaks on all raised exceptions while breaking properly in class code. When the debugger breaks on class instantiation only there is no indication of which line actually caused the exception. In a large class this makes debugging in Visual Studio a tedious process of manually stepping through code or pressing continue for each handled exception.
Steps to Reproduce
Exception Details:
Message=name 'j' is not defined
Source=...\Scratch.py
StackTrace:
File "...\Scratch.py", line 14, in
H=h()
3.Enable Python Exceptions (there is no Handled Exceptions option to deselect in the list). Run with Debugging: Breaks on Handled Exception (not wanted behaviour)
4. Continue to next exception. Breaks where the exception actually occurred (wanted behaviour) in the class and then on instantiation after continuing again.
After Continue
Expected behavior
The ability to skip handled exceptions and break in class code not only on instantiation. VSCode for example, by selecting break on uncaught Exceptions only the debugger breaks in the class code and skips the handled exception. In a large class this makes debugging in Visual Studio a tedious process which is why I use the VScode debugger to find bugs in large classes
Sample Code
#Handled exception
try:
raise ValueError
except:
pass
class H(object):
def init(self):
#unhandled exception
print(j)
if name == "main":
h=H()
This also occurs if the exception is not in init:
Behaviour is not seen when not using classes.
Configuration information (If you are providing a diagnostics file (see below), skip this section)
VS Version: 16.8.0
PTVS version: 16.8.20241.2
Python version:
Debugger Type (if applicable): New debugger, have not tried on Legacy yet
Diagnostics file
Diagnostic Info 2020-11-19T111217.txt
The text was updated successfully, but these errors were encountered: