Closed Bug 923010 Opened 11 years ago Closed 11 years ago

no file or line number for exceptions from JS-implemented webidl object

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: jib, Assigned: bzbarsky)

References

Details

(Whiteboard: [WebRTC])

Attachments

(1 file)

As a followup to bug 905392, it would be great if we could see file and line number in web console for error messages thrown by JS-implemented webidl objects.

The file and line number should point to the JS content call site, not chrome.

Example:

Right now, users see thrown WebRTC API-errors in web console like this:

  Error: createAnswer passed invalid constraints - unsupported mandatory
  constraint: OfferToReceiveAudio

with no link to where this createAnswer is called from. If file and line number were provided, they could click the link to get to their source to see the problem.
Jan-Ivar, could you attach a testcase that shows the problem, please, so I can debug what's going on here?  I would have expected this to work already, and assumed it did given the patch in bug 905392.
Ah, I guess this shows it:

  var conn = new mozRTCPeerConnection();
  conn.createAnswer(function() {}, null, { "mandatory": { "BOGUS": 5 } } )
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [WebRTC] → [need review][WebRTC]
(In reply to Boris Zbarsky [:bz] from comment #2)
> Ah, I guess this shows it:

Yes, or (from bug 903741 comment 3):
> var pc = new mozRTCPeerConnection({ iceServers: [{ url:"html:x.net" }]}, {});

> I would have expected this to work already, and assumed it did given the patch in bug 905392.

Looks like it got lost, as I see no file or line number in 25, 26 or Nightly.
Yeah, the JS engine error-reporting APIs are full of fail.  :(
Comment on attachment 813112 [details] [diff] [review]
When rethrowing exceptions from JS-implemented components to content script, make sure to give them a useful filename and line number, pointing to the content script location that triggered the exception.

Review of attachment 813112 [details] [diff] [review]:
-----------------------------------------------------------------

Weird, I remember doing something like this but I don't see it in the patches :-/.
Attachment #813112 - Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7c5cd333e9c with a test tweak to deal with b2g not doing webrtc, apparently.
Whiteboard: [need review][WebRTC] → [WebRTC]
Target Milestone: --- → mozilla27
https://hg.mozilla.org/mozilla-central/rev/b7c5cd333e9c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: