client/general: make fatal errors fatal
This commit is contained in:
parent
8c952c08d0
commit
abd679888a
2 changed files with 4 additions and 5 deletions
|
@ -97,7 +97,7 @@ class Api {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (minViableRank === null) {
|
if (minViableRank === null) {
|
||||||
console.error('Bad privilege name: ' + lookup);
|
throw `Bad privilege name: ${lookup}`;
|
||||||
}
|
}
|
||||||
let myRank = this.user !== null ?
|
let myRank = this.user !== null ?
|
||||||
this.allRanks.indexOf(this.user.rank) :
|
this.allRanks.indexOf(this.user.rank) :
|
||||||
|
|
|
@ -249,8 +249,7 @@ function htmlToDom(html) {
|
||||||
|
|
||||||
function getTemplate(templatePath) {
|
function getTemplate(templatePath) {
|
||||||
if (!(templatePath in templates)) {
|
if (!(templatePath in templates)) {
|
||||||
console.error('Missing template: ' + templatePath);
|
throw `Missing template: ${templatePath}`;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
const templateFactory = templates[templatePath];
|
const templateFactory = templates[templatePath];
|
||||||
return ctx => {
|
return ctx => {
|
||||||
|
@ -319,8 +318,8 @@ function showView(target, source) {
|
||||||
}
|
}
|
||||||
} else if (source instanceof Node) {
|
} else if (source instanceof Node) {
|
||||||
target.appendChild(source);
|
target.appendChild(source);
|
||||||
} else {
|
} else if (source !== null) {
|
||||||
console.error('Invalid view source', source);
|
throw `Invalid view source: ${source}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue