Skip to content

Commit

Permalink
syntax error message made more verbose (#1462)
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
  • Loading branch information
austinyu12 authored Oct 6, 2024
1 parent 519ffc4 commit 73793a4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ext/js/dictionary/dictionary-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,16 @@ export class DictionaryImporter {
const results = [];
for (const file of files) {
const content = await this._getData(file, new TextWriter());
/** @type {unknown} */
const entries = parseJson(content);
let entries;

try {
/** @type {unknown} */
entries = parseJson(content);
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message + ` in '${file.filename}'`);
}
}

startIndex = progressData.index;
this._progress();
Expand Down

0 comments on commit 73793a4

Please sign in to comment.