Better error handling
This commit is contained in:
parent
700cad1000
commit
979041dacb
6 changed files with 44 additions and 21 deletions
|
@ -134,6 +134,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