Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make errors in conditional breakpoints more clear in logs #893

Closed
softloft38p-michael opened this issue Apr 8, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@softloft38p-michael
Copy link

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.
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Apr 9, 2022
@int19h int19h added the enhancement New feature or request label Apr 13, 2022
@fabioz
Copy link
Collaborator

fabioz commented Apr 14, 2022

I'm thinking about changing:

Error while evaluating expression: ...

to:

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants