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
Are there ways to improve the error reporting when a conditional breakpoint is the source of a parsing error while debugging?
I had a bug in a breakpoint which I did not realize was set and it was printing a message like so:
Error while evaluating expression: str(p).lower.endswith('.txt')
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'endswith'
This does not provide any information that this code was being referenced from a breakpoint. I spent a significant amount of time trying to track down this bug in my code using search and wrapping things in try/except to no avail. Adding a formatter to my logger to try to print more precise locations for the message had no effect on these log messages and turning on Raised Exceptions, Uncaught Exceptions and User Uncaught Exceptions all also did not help.
It would be great to have some context that points to the error coming from the logic in the breakpoint. A few ideas:
Make the debugger pause on a failed breakpoint (perhaps behind a checkbox that can be toggled)
Make the log include some indication that it was from a breakpoint either with a message, custom exception or the file and line where the breakpoint was set that caused the error.
The text was updated successfully, but these errors were encountered:
pydevd: Error while evaluating expression in conditional breakpoint: ...
to make it clearer for users that this is from the debugger in a conditional breakpoint (as a note, the pydevd prefix is used in many places already and this would make it consistent with other places).
fabioz
added a commit
to fabioz/debugpy
that referenced
this issue
Apr 14, 2022
Are there ways to improve the error reporting when a conditional breakpoint is the source of a parsing error while debugging?
I had a bug in a breakpoint which I did not realize was set and it was printing a message like so:
This does not provide any information that this code was being referenced from a breakpoint. I spent a significant amount of time trying to track down this bug in my code using search and wrapping things in try/except to no avail. Adding a formatter to my logger to try to print more precise locations for the message had no effect on these log messages and turning on
Raised Exceptions
,Uncaught Exceptions
andUser Uncaught Exceptions
all also did not help.It would be great to have some context that points to the error coming from the logic in the breakpoint. A few ideas:
The text was updated successfully, but these errors were encountered: