From 99d00d79f2495a2dcc040704951ceeda947add5a Mon Sep 17 00:00:00 2001 From: Austin Yu <52673267+austinyu12@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:42:38 -0700 Subject: [PATCH] ExtensionError when validating dictionary includes error cause (#1473) * syntax error message more verbose made the syntax error when validating a dictionary also provide the name of the term bank that contains the error * removed unnecessary error logging and fixed syntax * more verbose extension error made the extension error when validating a dictionary provide the cause of error --- ext/js/dictionary/dictionary-importer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/js/dictionary/dictionary-importer.js b/ext/js/dictionary/dictionary-importer.js index 13fbb7078c..e8a72ba821 100644 --- a/ext/js/dictionary/dictionary-importer.js +++ b/ext/js/dictionary/dictionary-importer.js @@ -373,10 +373,9 @@ export class DictionaryImporter { * @returns {ExtensionError} */ _formatAjvSchemaError(schema, fileName) { - const e2 = new ExtensionError(`Dictionary has invalid data in '${fileName}'`); - e2.data = schema.errors; - - return e2; + const e = new ExtensionError(`Dictionary has invalid data in '${fileName}' '${JSON.stringify(schema.errors)}'`); + e.data = schema.errors; + return e; } /**