Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure errors in webpack.run callback always reject #838

Merged
merged 2 commits into from Jun 7, 2021

Conversation

stefanpenner
Copy link
Collaborator

Ensure all throws, including the explicit throw, correctly reject the wrapping promise.


As far as I can tell, this isn't the root cause of any posted issues, but something I noticed while debugging a different issue.

Ensure all `throws`, including the explicit throw, correctly reject the wrapping promise
Co-authored-by: Robert Jackson <rjackson@linkedin.com>
if (!stats) {
// this doesn't really happen, but webpack's types imply that it
// could, so we just satisfy typescript here
throw new Error('bug: no stats and no err');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is what lead me here, but in general try/catch in these async promise resolvers is best practice. Avoiding dropped errors, and breaking the implied contract of the wrapping promise

@rwjblue rwjblue merged commit bb10b4c into master Jun 7, 2021
@rwjblue rwjblue deleted the fix-webpack-run-cb branch June 7, 2021 21:09
@rwjblue rwjblue changed the title Fix webpack.run callback Ensure errors in webpack.run callback always reject Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants