Skip to content

Conversation

@JakobJingleheimer
Copy link
Member

Currently, an error thrown during module job evaluation is uncatchable. Such errors should be catchable in a custom loader.

@JakobJingleheimer JakobJingleheimer added esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders labels Aug 25, 2022
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/modules

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 25, 2022
const namespaces = await PromiseAll(new SafeArrayIterator(jobs));
const namespaces = await PromisePrototypeCatch(
PromiseAll(new SafeArrayIterator(jobs)),
(err) => { throw err; }, // Make errors catchable in a custom loader.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the default catch handler - I’m not sure why this has any effect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'm confused: it wasn't working before this, I add it, it's working, I remove it, it's still working.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's probably something else that changed on your end, this change should have no effect on the catchability of errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. I can't explain it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants