Skip to content

Commit

Permalink
Catch and process possible exception on applying compiled layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Cherniavsky committed Mar 7, 2017
1 parent 3bb3b07 commit fe21943
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ module.exports = function (opts) {
})

// Render the content using the template function and options.
var output = templates[layoutName].fn(locals)
files[file].contents = output
try {
files[file].contents = templates[layoutName].fn(locals)
} catch (e) {
done(e)
}

// Allow for recursive explicit layouts.
layoutName = files[layoutName].layout
Expand Down

0 comments on commit fe21943

Please sign in to comment.