mirror of https://github.com/zulip/zulip.git
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:
parent
9b7a3f040c
commit
30c654f83f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue