8000 shold emit webpack Error rather than throwing (#256) · vuejs/vue-loader@322cf4d · GitHub
[go: up one dir, main page]

Skip to content

Commit 322cf4d

Browse files
Eden-Sunyyx990803
authored andcommitted
shold emit webpack Error rather than throwing (#256)
* shold emit webpack Error rather than throwing * just callback can emit the error * should return
1 parent 3cfb27e commit 322cf4d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/template-loader.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ module.exports = function (content) {
2727
}
2828

2929
if (!cons[opt.engine]) {
30-
throw new Error(
30+
return callback(new Error(
3131
'Template engine \'' + opt.engine + '\' ' +
3232
'isn\'t available in Consolidate.js'
33-
)
33+
))
3434
}
3535

3636
// for relative includes
3737
opt.filename = this.resourcePath
3838

3939
cons[opt.engine].render(content, opt, function (err, html) {
4040
if (err) {
41-
throw err
41+
callback(err)
42+
} else {
43+
exportContent(html)
4244
}
43-
exportContent(html)
4445
})
4546
}

0 commit comments

Comments
 (0)
0