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

Uncaught exception from renderers #8070

Merged
merged 1 commit into from Sep 22, 2018
Merged

Uncaught exception from renderers #8070

merged 1 commit into from Sep 22, 2018

Conversation

chuckdumont
Copy link
Contributor

Prior to 4.19.0, exceptions thrown by plugins that hooked any of the bootstrap rendering events (e.g. beforeStartup, requireEnsure, etc.) were caught and the error message was added to compilation.errors. This occurred because compilation.createChunkAssets() has a try/catch block that catches and processes exceptions thrown by the renderers.

Starting with 4.19.0, the bootstrap rendering code is now also called via compilation.createHash(). Any exceptions thrown by the rendering code from this call are not caught and the exceptions propagates up to node and the application is terminated.

This pr adds exception handling code to compilation.createHash() that is similar to what compilation.createChunkAssets() does so that exceptions thrown by bootstrap rendering code will be handled in a similar way.

What kind of change does this PR introduce?
Improves exception handling

bugfix
Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
no documentation needed

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit 1495b33 into webpack:master Sep 22, 2018
@sokra
Copy link
Member

sokra commented Sep 22, 2018

Thanks

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

Successfully merging this pull request may close these issues.

None yet

3 participants