Skip to content

Commit

Permalink
add current file name to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Lusk committed Mar 20, 2019
1 parent 67738e0 commit f99e232
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ function render({ filename, files, metadata, engineOptions }) {

// Transform the contents
debug(`rendering ${ext} extension for ${filename}`);
file.contents = transform.render(file.contents, engineOptions, locals).body;
try {
file.contents = transform.render(file.contents, engineOptions, locals).body;
} catch (err) {
err.message = `${filename}: ${err.message}`;
throw err;
}
}

// Store results and delete old file
Expand Down

0 comments on commit f99e232

Please sign in to comment.