diff options
Diffstat (limited to 'lib/template.js')
-rw-r--r-- | lib/template.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/template.js b/lib/template.js index 320c8bf..187df87 100644 --- a/lib/template.js +++ b/lib/template.js @@ -331,7 +331,13 @@ TemplateEngine.prototype.renderString = function(content, context, options) { // Replace shortcuts content = _.reduce(this.shortcuts, _.partial(this._applyShortcut.bind(this), options.type), content); - return Q.nfcall(this.env.renderString.bind(this.env), content, context, options); + return Q.nfcall(this.env.renderString.bind(this.env), content, context, options) + .fail(function(err) { + if (_.isString(err)) err = new Error(err); + err.message = err.message.replace(/^Error: /, ""); + + throw err; + }); }; // Render a file from the book |