Skip to content

Commit

Permalink
ExtensionError when validating dictionary includes error cause (#1473)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
austinyu12 authored Oct 14, 2024
1 parent b51c094 commit 99d00d7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ext/js/dictionary/dictionary-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 99d00d7

Please sign in to comment.