templates: Fix stack traces throwing handlebars errors.

This fixes the fact that we weren't using `throw` correctly, and also
the "handlerbars" typo.

Fixes #2143.
This commit is contained in:
Tim Abbott 2016-10-27 22:01:45 -07:00
parent 9b7a3f040c
commit 30c654f83f
1 changed files with 3 additions and 3 deletions

View File

@ -4,13 +4,13 @@ var exports = {};
exports.render = function (name, arg) {
if (Handlebars.templates === undefined) {
throw "Cannot find compiled templates!";
throw new Error("Cannot find compiled templates!");
}
if (Handlebars.templates[name] === undefined) {
throw "Cannot find a template with this name: " + name
throw new Error("Cannot find a template with this name: " + name
+ ". If you are developing a new feature, this likely"
+ "means you need to add the file static/templates/"
+ name + ".handlerbars";
+ name + ".handlebars");
}
// The templates should be compiled into compiled.js. In