Better error handling
This commit is contained in:
parent
700cad1000
commit
979041dacb
6 changed files with 44 additions and 21 deletions
|
@ -217,12 +217,17 @@ class MiscThemeChecks extends DesugaringStep<LayoutConfigJson>{
|
|||
|
||||
convert(json: LayoutConfigJson, context: string): { result: LayoutConfigJson; errors?: string[]; warnings?: string[]; information?: string[] } {
|
||||
const warnings = []
|
||||
const errors = []
|
||||
if(json.id !== "personal" && (json.layers === undefined || json.layers.length === 0)){
|
||||
errors.push("The theme "+json.id+" has no 'layers' defined ("+context+")")
|
||||
}
|
||||
if(json.socialImage === ""){
|
||||
warnings.push("Social image for theme "+json.id+" is the emtpy string")
|
||||
}
|
||||
return {
|
||||
result :json,
|
||||
warnings
|
||||
warnings,
|
||||
errors
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -231,8 +236,8 @@ export class PrevalidateTheme extends Fuse<LayoutConfigJson> {
|
|||
|
||||
constructor() {
|
||||
super("Various consistency checks on the raw JSON",
|
||||
new OverrideShadowingCheck(),
|
||||
new MiscThemeChecks()
|
||||
new MiscThemeChecks(),
|
||||
new OverrideShadowingCheck()
|
||||
);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue