forked from MapComplete/MapComplete
Robuster handling, add helpful error messages for wrong themes
This commit is contained in:
parent
554fefd708
commit
8ca5a99797
2 changed files with 13 additions and 0 deletions
|
@ -104,6 +104,15 @@ export default class TagRenderingConfig {
|
|||
if (mapping.ifnot !== undefined && !this.multiAnswer) {
|
||||
throw `${context}.mapping[${i}]: Invalid mapping: ifnot defined, but the tagrendering is not a multianswer`
|
||||
}
|
||||
|
||||
if(mapping.if === undefined){
|
||||
throw `${context}.mapping[${i}]: Invalid mapping: "if" is not defined, but the tagrendering is not a multianswer`
|
||||
}
|
||||
if(typeof mapping.if !== "string" && mapping.if["length"] !== undefined){
|
||||
throw `${context}.mapping[${i}]: Invalid mapping: "if" is defined as an array. Use {"and": <your conditions>} or {"or": <your conditions>} instead`
|
||||
}
|
||||
|
||||
|
||||
let hideInAnswer: boolean | TagsFilter = false;
|
||||
if (typeof mapping.hideInAnswer === "boolean") {
|
||||
hideInAnswer = mapping.hideInAnswer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue