From 0801b020b0928fa618b59606ac150922cd1338c2 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 14 Feb 2022 06:06:08 +0300 Subject: [PATCH] Update validate.js --- scripts/db/validate.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/db/validate.js b/scripts/db/validate.js index 7ae54c4b..72ff6d1d 100644 --- a/scripts/db/validate.js +++ b/scripts/db/validate.js @@ -20,12 +20,15 @@ async function main() { ] for (const filepath of files) { if (!filepath.endsWith('.csv')) continue - const data = await csv.load(filepath) + const data = await csv.load(filepath).catch(err => { + logger.error(chalk.red(`\n${err.message} (${filepath})`)) + process.exit(1) + }) const filename = file.getFilename(filepath) if (!schemes[filename]) { - logger.error(chalk.red(`\nERR: "${filename}" scheme is missing`)) + logger.error(chalk.red(`\nError: "${filename}" scheme is missing`)) process.exit(1) }