Closed Bug 584793 Opened 14 years ago Closed 9 years ago

ReferenceErrors in streamlistener callbacks are swallowed

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jdm, Unassigned)

References

Details

(Whiteboard: [necko-backlog])

Attachments

(1 file)

This is extremely frustrating, as the callbacks fail silently.  I had |do_check_eq(this._variable, NONEXISTANT_CONSTANT)| which gave me no output.
Actually, I suppose the real problem is that ReferenceErrors are not detected or something, because when I changed NONEXISTANT_CONSTANT to an actual constant, the test fails just fine.
Summary: Test failures in streamlistener callbacks are swallowed → ReferenceErrors in streamlistener callbacks are swallowed
So there's a reason that the default ChannelListener callbacks are all wrapped in try/catch blocks. I propose we implement a ChannelForwarder that takes a listener and forwards all calls to it safely, so that we can write custom listeners without the try/catch annoyances.
Component: XPCShell Harness → Networking
Product: Testing → Core
QA Contact: xpcshellharness → networking
Comment on attachment 477553 [details] [diff] [review]
Add ChannelForwarder to make use of custom channel listeners easier in network xpcshell tests.

Here's what I had in mind.
Attachment #477553 - Flags: review?(jduell.mcbugs)
Comment on attachment 477553 [details] [diff] [review]
Add ChannelForwarder to make use of custom channel listeners easier in network xpcshell tests.

"ChannelForwarder" is not a very descriptive name.  How about "ListenerExceptionReporter"?  Either way, couldn't hurt to add a comment like this:

// Exceptions from OnStart/Data/Stop are silently eaten by default: this class
// converts them to xpcshell errors.
 
>+function ChannelForwarder(listener) {
>+  this._listener = listener;
>+}
Attachment #477553 - Flags: review?(jduell.mcbugs) → review+
there is a r+ patch here.. should it be checked in? should the bug be otherwise closed?
Flags: needinfo?(jduell.mcbugs)
Whiteboard: [necko-backlog]
The fact that this is an opt-in tool means that nobody will use it, in all likelihood. I don't think it's worth trying to pursue this solution.
OK, then.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(jduell.mcbugs)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: