Closed Bug 1543751 Opened 5 years ago Closed 5 years ago

Stacks are missing for uncaught exceptions in workers


(DevTools :: Console, defect, P2)



(firefox68 fixed)

Firefox 68
Tracking Status
firefox68 --- fixed


(Reporter: bhackett1024, Assigned: bhackett1024)


(Blocks 1 open bug)



(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, 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
Part 1 - Add API to set the stack for a pending exception, r=sfink.
Part 2 - Include stack in worker error reports, r=bz.
Part 3 - Use stack for error location if none was specified, r=nchevobbe.
Part 4 - Add test for uncaught worker errors.
You need to log in before you can comment on or make changes to this bug.