Provide better error message when loading missing JSM
Categories
(Core :: XPConnect, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(3 files)
When the JSM-to-ESM shim fails, the error message for .sys.mjs
URL is printed, instead of the .jsm
URL, which is confusing when investigating the issue. (see bug 1786667)
The error message should take the redirect into account and print better message that mentions the existence of the redirect, and possible old URL or something.
Assignee | ||
Comment 1•2 years ago
|
||
currently, the error message for JSM is suppressed (bug 1777641), and the error message is not suppressed for redirected ESM,
that leads to the confusing error message when the ESM is also not found.
possible workaround is to suppress the error message for redirected ESM, and if the redirect fails, load the JSM again with the error message not-suppressed.
so that the error or crash-on-automation happens for the original URL happens when both are missing.
Assignee | ||
Comment 2•2 years ago
|
||
the other simple option is to mention the possible redirect in the actual error message string:
if (xpc::IsInAutomation()) {
#ifdef DEBUG
if (NS_IsMainThread()) {
nsCOMPtr<nsIXPConnect> xpc = nsIXPConnect::XPConnect();
Unused << xpc->DebugDumpJSStack(false, false, false);
}
#endif
MOZ_CRASH_UNSAFE_PRINTF("Missing chrome or resource URLs: %s", spec.get());
} else {
printf_stderr("Missing chrome or resource URL: %s\n", spec.get());
}
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D156762
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D156763
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4444217fdc0c
https://hg.mozilla.org/mozilla-central/rev/364b5631681a
https://hg.mozilla.org/mozilla-central/rev/04dc31eaa8ed
Description
•