client/general: make fatal errors fatal

This commit is contained in:
rr- 2016-06-11 09:30:22 +02:00
parent 8c952c08d0
commit abd679888a
2 changed files with 4 additions and 5 deletions

View file

@ -97,7 +97,7 @@ class Api {
}
}
if (minViableRank === null) {
console.error('Bad privilege name: ' + lookup);
throw `Bad privilege name: ${lookup}`;
}
let myRank = this.user !== null ?
this.allRanks.indexOf(this.user.rank) :

View file

@ -249,8 +249,7 @@ function htmlToDom(html) {
function getTemplate(templatePath) {
if (!(templatePath in templates)) {
console.error('Missing template: ' + templatePath);
return null;
throw `Missing template: ${templatePath}`;
}
const templateFactory = templates[templatePath];
return ctx => {
@ -319,8 +318,8 @@ function showView(target, source) {
}
} else if (source instanceof Node) {
target.appendChild(source);
} else {
console.error('Invalid view source', source);
} else if (source !== null) {
throw `Invalid view source: ${source}`;
}
}