diff --git a/ext/js/dictionary/dictionary-importer.js b/ext/js/dictionary/dictionary-importer.js index a558853e6e..13fbb7078c 100644 --- a/ext/js/dictionary/dictionary-importer.js +++ b/ext/js/dictionary/dictionary-importer.js @@ -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();