Skip to content

Commit

Permalink
Merge pull request #20 from ycherniavsky/catch-compiled-layout-error
Browse files Browse the repository at this point in the history
Catch and process possible exception on applying compiled layout
  • Loading branch information
RobLoach authored Mar 7, 2017
2 parents 3bb3b07 + fe21943 commit d5d702e
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 d5d702e

Please sign in to comment.