Closed Bug 1979728 Opened 1 year ago Closed 1 year ago

Errors from subprocess worker do not include the original stack

Categories

(Toolkit :: Async Tooling, task)

task

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 external file)

While working on bug 1979546, I noticed that runtime errors in the subprocess module do not include a stack trace of the true source of the error.

E.g. if I intentionally throw from here by calling a non-existing function throwMe();,

then the console (pasted from a xpcshell test) contains the following entries:

  • [JavaScript Error: "uncaught exception: Object" { file: "resource://gre/modules/subprocess/subprocess_common.sys.mjs" line: 199 }] (link to source)
  • console.error: (new NotSupportedError("ClonedErrorHolder constructor: We can only clone DOM Exceptions and native JS Error objects", (void 0), 219)).
  • [JavaScript Error: "throwMe not defined" {file: "resource://gre/modules/NativeMessaging.sys.mjs" line: 133 }] (link to source)

I think that this is happening because we turn an error into an object at https://searchfox.org/mozilla-central/rev/45aff2630491c295fc6c28198b629ff2de14e637/toolkit/modules/subprocess/subprocess_worker_common.js#206-215
Probably because the code predates support for errors in structured cloning.

Let's simplify the implementation so that true errors are reported, without strange bugs.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [qa-triage-done-c144/b143]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: