forked from MapComplete/MapComplete
Better error handling
This commit is contained in:
parent
e5dbeee621
commit
ad3a776366
6 changed files with 106 additions and 78 deletions
|
@ -133,6 +133,9 @@ export default class LayerConfig extends WithContextLoader {
|
|||
|
||||
this.allowSplit = json.allowSplit ?? false;
|
||||
this.name = Translations.T(json.name, translationContext + ".name");
|
||||
if(json.units!==undefined && !Array.isArray(json.units)){
|
||||
throw "At "+context+".units: the 'units'-section should be a list; you probably have an object there"
|
||||
}
|
||||
this.units = (json.units ?? []).map(((unitJson, i) => Unit.fromJson(unitJson, `${context}.unit[${i}]`)))
|
||||
|
||||
if (json.description !== undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue