Closed Bug 865073 Opened 8 years ago Closed 8 years ago
remote debugging protocol: handlers should systematically catch and log exceptions
It's the established pattern in Firefox for things like the observer service, listener callers, and the like to ignore exceptions thrown by the observer/listener/what-have-you. (This is kind of like littering, in that's it's a completely avoidable sin, and not even especially satisfying - except that this one can waste hours of someone's time. Not as bad as burglary, but... honestly, people.) Anyway, another way to look at it is to say that handlers must be infallible. The attached patch makes all the handlers I could find in the remote protocol server infallible, by wrapping them with a function that catches and logs errors. This can then replace the extant one-off catch clauses attempting to address the problem. Not requesting review yet, as this patch reveals some silent failures. (Whodathunkit!)
Attachment #741126 - Flags: review?(dcamp) → review+
(In reply to Dave Camp (:dcamp) from comment #1) > Most of our non-constructor functions are camelCase, is this different on > purpose? No; I've changed it. Thanks for pointing this out. > (also: dbg-transport.js is a weird place for this, but it's the best option > for now. We can fix that soon). Yeah; it's the only thing shared between dbg-client.jsm and the server-side stuff. It would be nice to have a devtools utilities file... although those always turn into junk drawers, or grow more structure than they ought.
Status: NEW → ASSIGNED
Target Milestone: --- → Firefox 23
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.