Option to enable breakpoints to stop when warnings are raised in the python debugger #16271
Replies: 2 comments
-
If you want Python to raise warnings as exceptions, you can do that from the command-line with See https://docs.python.org/3/library/warnings.html#describing-warning-filters for more details (including finer-grained control over what to do for different warnings). |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moved to #17200 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice if under the breakpoints drop down in the debugger if there was an option to set a breakpoints for warnings (understanding that warnings are handled completely different from exceptions in python). Numpy allows raising warnings as errors "np.seterr(all='raise')", this can be used to help locate what is causing a divide by zero warning for example. But most packages dont have this feature, and tracing down warning while looping over large sets of data can often require print statements to locate which input data is causing a warning inside a package. Having the feature in vscode debugging to add breakpoints to stop on warnings would be very helpful. (This a popular feature in MATLAB for example, allowing the user to stop on warnings).
Beta Was this translation helpful? Give feedback.
All reactions