Skip to content

Commit

Permalink
syntax error message made more verbose
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

<rikaitan.link>NzM3OTNhNDY0OTE5NDY1NmQ3MjVlYTEyOTJjNGE2Y2NhMmI0ZTk2OQo=</rikaitan.link>
  • Loading branch information
jason-ojisan committed Oct 6, 2024
1 parent 8fcc560 commit 716b8e0
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 716b8e0

Please sign in to comment.