err.file for #renderFile()

This commit is contained in:
harttle
2016-06-24 12:25:55 +08:00
parent aebf9812cb
commit 88b2dc3795
3 changed files with 23 additions and 3 deletions
+8 -2
View File
@@ -42,8 +42,14 @@ var _engine = {
return this.render(tpl, ctx);
},
renderFile: function(filepath, ctx) {
var tpl = this.handleCache(filepath);
return this.render(tpl, ctx);
try{
var tpl = this.handleCache(filepath);
return this.render(tpl, ctx);
}
catch(e){
e.file = filepath;
throw e;
}
},
evalOutput: function(str, scope) {
var tpl = this.parser.parseOutput(str.trim());