diff options
-rw-r--r-- | ext/bg/js/dictionary-importer.js | 2 | ||||
-rw-r--r-- | ext/bg/js/settings/dictionaries.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/dictionary-importer.js b/ext/bg/js/dictionary-importer.js index 589e7656..607a8b5e 100644 --- a/ext/bg/js/dictionary-importer.js +++ b/ext/bg/js/dictionary-importer.js @@ -180,7 +180,7 @@ class DictionaryImporter { try { await database.bulkAdd(objectStoreName, entries, i, count); } catch (e) { - errors.push(e); + errors.push(errorToJson(e)); } loadedCount += count; diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js index 5e59cc3d..ed883869 100644 --- a/ext/bg/js/settings/dictionaries.js +++ b/ext/bg/js/settings/dictionaries.js @@ -643,9 +643,9 @@ async function onDictionaryImport(e) { await settingsSaveOptions(); if (errors.length > 0) { - errors.push(...errors); - errors.push(`Dictionary may not have been imported properly: ${errors.length} error${errors.length === 1 ? '' : 's'} reported.`); - dictionaryErrorsShow(errors); + const errors2 = errors.map((error) => jsonToError(error)); + errors2.push(`Dictionary may not have been imported properly: ${errors2.length} error${errors2.length === 1 ? '' : 's'} reported.`); + dictionaryErrorsShow(errors2); } onDatabaseUpdated(); |