Skip to content

shold emit webpack Error rather than throwing #256

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

Merged
merged 3 commits into from
Jun 16, 2016
Merged

shold emit webpack Error rather than throwing #256

merged 3 commits into from
Jun 16, 2016

Conversation

Eden-Sun
Copy link

@Eden-Sun Eden-Sun commented Jun 16, 2016

prevent webpack crashing when templateLoader compiled errors.
vuejs/vue-cli#111

@@ -27,18 +28,18 @@ module.exports = function (content) {
}

if (!cons[opt.engine]) {
throw new Error(
emitError(new Error(
Copy link
Member

Choose a reason for hiding this comment

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

We should just call callback here with the error as the first argument. Also need to return early, so return callback(new Error('...'))

@@ -27,19 +27,20 @@ module.exports = function (content) {
}

if (!cons[opt.engine]) {
throw new Error(
callback(new Error(
Copy link
Member

Choose a reason for hiding this comment

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

we need to return here otherwise the code below will throw another error.

@yyx990803 yyx990803 merged commit 322cf4d into vuejs:master Jun 16, 2016
@yyx990803
Copy link
Member

Thanks!

hinablue pushed a commit to hinablue/vue-loader that referenced this pull request Oct 3, 2016
* shold emit webpack Error rather than throwing

* just callback can emit the error

* should return
hinablue pushed a commit to hinablue/vue-loader that referenced this pull request Oct 26, 2016
* shold emit webpack Error rather than throwing

* just callback can emit the error

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

Successfully merging this pull request may close these issues.

2 participants