Conditional breakpoints should not pause on exceptions

RESOLVED FIXED in Firefox 69

Status

enhancement
P3
normal
RESOLVED FIXED
7 months ago
2 months ago

People

(Reporter: jlast, Assigned: chujunlu)

Tracking

(Blocks 1 bug)

unspecified
Firefox 69
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(1 obsolete attachment)

I've found it pretty confusing when conditional breakpoints pause with exceptions:

  1. in this case, the user expects something good to have happened and it can be hard to find the exception and debug the condition
  2. sometimes the expression throws a lot when a function is called at times you do not care about it... like initialization
  3. chrome does not pause on exceptions, which led me to believe neither would firefox

It looks like this was added because it can be confusing to not pause for typos. I think terminal style autocomplete should help with this quite a bit.

https://bugzilla.mozilla.org/show_bug.cgi?id=983469

Severity: normal → enhancement
Flags: needinfo?(odvarko)
Flags: needinfo?(lsmyth)
Flags: needinfo?(hkirschner)
Flags: needinfo?(dwalsh)

+1 for Chrome parity, and this also allows to be more lax with expressions and type checking.

To allow the old behavior, would it make sense to pause when "pause on caught exception" is enabled?

Flags: needinfo?(hkirschner)

+1 to what Harald said. Does the "why" pause reason display the correct message? That's something we should look at as well.

Flags: needinfo?(dwalsh)

Agree with what was said above

To sum up:

  • Chrome parity
  • I like the idea to pause when "pause on caught exception" or "Pause on exceptions"? is on.
  • It would be nice to see the exception in the Console (+ indication that it comes from conditional BP from given file/line)
  • Showing explanatory message in the Callstack would also be helpful (perhaps with a link to the exception log in the Console)

Honza

Flags: needinfo?(odvarko)

I agree that pausing in them is confusing and likely not what the user expects.

I'm not sure catching with pause on caught exception would be that useful in most cases since they are usually small snippets, and it may well still be common for them to throw in some cases.

I do agree that it could be nice to log the exceptions to the console.

Flags: needinfo?(lsmyth)
Priority: -- → P3
Blocks: dbg-control

Hey @jlast, I'm interested in this bug.

When "Pause on exception" is checked, and I refresh the page to execute code, a new file is opened to show conditional breakpoint expression's error. That's different from other scenarios. I documented all scenarios in
https://docs.google.com/spreadsheets/d/1VIQpKgFHv8AhgwUYZ1JaQBr3AOSZojnlcSi6VB4gWUQ/edit?usp=sharing

For now, I remove the pause and log an error message in the console, if "Pause on exception" is unchecked. If "Pause on exception" is checked, I keep the old behaviors. I'm not sure if you want not to pause even when "Pause on exception" is checked. I'd like to check with you before I proceed to edit tests. Thanks!

test_conditional_breakpoint-03.js tests the behavior of the last case in the Google sheet.

I'm not sure if it's the correct way to test a breakpoint doesn't pause in test_conditional_breakpoint-04.js. Look forward to your feedback.

Assignee: nobody → chujunlu
Status: NEW → ASSIGNED
Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e1415c18f96d
Invalid conditional breakpoint only pauses when pauseOnExceptions is checked
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
Attachment #9072565 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.