Closed
Bug 903539
Opened 11 years ago
Closed 11 years ago
When a peer connection object is created with a TURN server without creds provided, fire a more useful exception, not NS_ERROR_FAILURE or NS_ERROR_UNEXPECTED
Categories
(Core :: WebRTC, defect)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: jsmith, Assigned: jib)
Details
Attachments
(1 file)
2.64 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
Per the discussion on bug 902615 - creating a peer connection right now with a TURN server without creds included does fire an exception, but not a web developer friendly one. We are firing either NS_ERROR_UNEXPECTED or NS_ERROR_FAILURE. Let's throw a more friendly exception message so that the developer is aware of what goes wrong clearly.
Assignee | ||
Comment 1•11 years ago
|
||
In general, in the few places where PeerConnection.js makes synchronous calls into c++ (which is PeerConnection construction, and that's pretty much it) we have a problem where synchronous failures from c++ don't propagate useful info up to the JS as an exception, and we get opaque error codes like NS_ERROR_FAILURE instead.
To compensate, the approach we've taken is to verify inputs in the JS, which catches most pilot errors early.
In this case, since the JS already has the job of validating the iceServer inputs, improving that validation code to require the username and credential and throw a nice message otherwise, is trivial.
Assignee: nobody → jib
Assignee | ||
Comment 2•11 years ago
|
||
iceServer validation code now also checks for missing username and password on turn servers, and throws nice messages (which show in the error console, not the web console, just like our other errors here. I've filed Bug 903741 for that).
Attachment #788498 -
Flags: review?(rjesup)
Assignee | ||
Comment 3•11 years ago
|
||
Updated•11 years ago
|
Attachment #788498 -
Flags: review?(rjesup) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 4•11 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Assignee | ||
Comment 6•11 years ago
|
||
Arguably, this is a regression in error message from FF22.
In FF22, if you pass in a turn uri without both username and credential (which is invalid):
{ iceServers: [{ url: "turn:turn.example.org" }] }
you get this warning in web console:
In RTCConfiguration passed to RTCPeerConnection constructor:
TURN servers not yet supported. Treating as STUN: "turn:turn.example.org"
Whereas in FF23 (without this patch uplifted), you get this instead:
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[IPeerConnection.initialize]
Too minor or too late to uplift?
Reporter | ||
Comment 7•11 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] from comment #6)
> Too minor or too late to uplift?
Probably too late for Fx23, but given that this is low risk and has a test, it probably doesn't hurt to ask for at least Aurora approval. Don't know about beta approval, although we could see what Alex & company think.
Assignee | ||
Comment 8•11 years ago
|
||
Note that Aurora regresses on ALL webrtc exception messages, not just this one, so uplifting this wouldn't help without Bug 903741.
You need to log in
before you can comment on or make changes to this bug.
Description
•