Closed
Bug 1791292
Opened 3 years ago
Closed 3 years ago
Propagate nsresult to JS exception in ESM APIs
Categories
(Core :: XPConnect, task)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
107 Branch
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
If the target file is not found ChromeUtils.import
throws DOM exception with nsresult
set as result
property, and it's used in the following case:
try {
const taskModule = ChromeUtils.import(URI);
...
} catch (ex) {
if (ex.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
throw ex;
}
}
bug 1778089 changed the ESM APIs to report human-friendly error message with the URL of the module, but it unintentionally removed the result
property.
we'd better reporting both the human-friendly error and the result
property'.
Assignee | ||
Comment 1•3 years ago
|
||
the DOM's Exception
has message
field, so if that can be directly set from loader, it would also work.
interface Exception {
...
[BinaryName="messageMoz"]
readonly attribute DOMString message;
Assignee | ||
Comment 2•3 years ago
|
||
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/51eb5e963b65
Expose nsresult for file-not-found error. r=jonco
![]() |
||
Comment 4•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox107:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•