config-loader: validate each schema upfront to provide a more precise error message
This commit is contained in:
@@ -69,6 +69,14 @@ export function compileConfigSchemas(
|
||||
},
|
||||
});
|
||||
|
||||
for (const schema of schemas) {
|
||||
try {
|
||||
ajv.compile(schema.value);
|
||||
} catch (error) {
|
||||
throw new Error(`Schema at ${schema.path} is invalid, ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
const merged = mergeAllOf(
|
||||
{ allOf: schemas.map(_ => _.value) },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user