On Tue, Feb 22, 2011 at 7:34 AM, John J Barton <[email protected]> wrote: > > > On Feb 21, 11:17 pm, laxeraend <[email protected]> wrote: >> This appears to create a normal breakpoint, triggered by the location, >> irrespective of whether an unhandled exception is thrown. There are >> situations when an app is unusable because such breakpoints are hit so >> frequently, and you simply don't care about 99.99% of such events, >> whereas the throwing of an unhandled exception is very significant and >> the only time you want to stop. What I am requesting is a breakpoint >> that's triggered by the throwing of a specific unhandled exception, >> not simply arriving at a given line of code. Such a breakpoint need >> not even be specific to a location, although the ability to restrict >> it to a line/function/file would also be helpful. What do you think? > > If you mean: "break on an exception only when sometime in the future > the exception is not trapped by a catch block", that is not possible. > At the time the exception is thrown we don't know if it will be caught > or not.
This should be filed as a feature request for the JS engine debugging support, though. As Andreas talked about, it would be possible to add an API entry to ask "will this exception be caught?" It would internally walk up the enclosing frames checking for an exception handler. It would still not be optimal when the exception is caught but then re-thrown. (I guess that's the only way to selectively handle exceptions in JS?) Perhaps that's when you turn to the querypoint stuff. Thinking about it, you probably want to get back the frame that will catch the exception, because you might have a catch-all in an outer script that should be treated as "uncaught". Though admittedly it may be painful to specify that in the UI. Maybe "break on exceptions thrown and not caught within the same file"? Or "ignore this catch statement for the purpose of deciding whether a thrown exception will be caught"? Also, the original request could probably be satisfied by a conditional throwHook breakpoint, using the type of exception as the condition. Is that supported? -- You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/firebug?hl=en.
