Skip to content
Snippets Groups Projects
Commit 8283fffe authored by Anjan Kaur's avatar Anjan Kaur
Browse files

log info about schema for which ajv will throw exception

parent 0b8f7e57
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,13 @@ if (target.isDirectory()) {
readdirp({ root: schemaPath, fileFilter: `*.${schemaExtension}` })
.on('data', entry => {
files.push(entry.fullPath);
ajv.addSchema(require(entry.fullPath), entry.fullPath);
try {
ajv.addSchema(require(entry.fullPath), entry.fullPath);
}catch(e){
logger.error('Ajv processing error for schema at path %s',entry.fullPath);
logger.error(e);
process.exit(1);
}
})
.on('end', () => {
Schema.setAjv(ajv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment