Closed Bug 1513028 Opened 7 years ago Closed 7 years ago

Loader throws empty exceptions when a module doesn't exists

Categories

(DevTools :: Framework, enhancement, P2)

enhancement

Tracking

(firefox66 fixed)

RESOLVED FIXED
Firefox 66
Tracking Status
firefox66 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

Details

Attachments

(1 file)

While trying to migrate the debugger to es modules, I was seeing various errors like this in the console, without any stack: JavaScript error: undefined, line 0: Error The best unactionable error report you could get! After some investigations I figured out it was because of the loader throwing empty exception from here: https://searchfox.org/mozilla-central/source/devtools/shared/base-loader.js#258 When a module path is wrong, loadSubScript throws a string exception. It is already bad as string exceptions: throw "exception" don't come with any stack, nor any location. The loader somehow tries to handle that, but fails.
Summary: Loads throws empty exceptions when a module doesn't exists → Loader throws empty exceptions when a module doesn't exists
Assignee: nobody → poirot.alex
Priority: -- → P2
loadSubScript throws a string, without any stack/location. Consider all string exceptions as coming from loadSubScript and re-throw a real error object, coming with the stack of the require call. Also handle wrong require path with a more explicit error message.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e3e0441c856 Throw exception with stack and message when a module doesn't exists. r=jdescottes
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: