Skip to content

Commit 60703ba

Browse files
committed
better template-loader error handling
1 parent ff5e94f commit 60703ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/template-loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ 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+
return callback(err)
4242
}
4343
exportContent(html)
4444
})

0 commit comments

Comments
 (0)