Closed Bug 1543751 Opened 1 year ago Closed 1 year ago

Stacks are missing for uncaught exceptions in workers

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Uncaught exceptions in worker threads are shown in the console, with the location of the place the exception was thrown from but no stack trace.

Using this test page https://melodic-client-1.glitch.me/, I don't even see the location.
The error object is created in dom/workers/WorkerError.cpp#487-491, using a nsScriptError, where it could use a nsScriptErrorWithStack I guess?

Brian, would you mind checking if this can be fixed quickly? Thanks!

Flags: needinfo?(bhackett1024)
Priority: -- → P2

I was working on this yesterday and should have a patch later today. We do need to use nsScriptErrorWithStack, but the tricky part is getting the stack info from the worker thread to the main thread (where the nsScriptErrorWithStack is created).

Flags: needinfo?(bhackett1024)

New test, for reference.

Comment on attachment 9058186 [details] [diff] [review]
Part 4 - Add test for uncaught worker errors.

Might be good to have tests for throwing |new DOMException| too.
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/57904fc5ae57
Part 1 - Add API to set the stack for a pending exception, r=sfink.
https://hg.mozilla.org/integration/mozilla-inbound/rev/39a877972476
Part 2 - Include stack in worker error reports, r=bz.
https://hg.mozilla.org/integration/mozilla-inbound/rev/e38792ce2185
Part 3 - Use stack for error location if none was specified, r=nchevobbe.
https://hg.mozilla.org/integration/mozilla-inbound/rev/f236858f5add
Part 4 - Add test for uncaught worker errors.
You need to log in before you can comment on or make changes to this bug.