Fix error reporting during dictionary import
This commit is contained in:
parent
3df78904cf
commit
7449ffd4dc
@ -180,7 +180,7 @@ class DictionaryImporter {
|
|||||||
try {
|
try {
|
||||||
await database.bulkAdd(objectStoreName, entries, i, count);
|
await database.bulkAdd(objectStoreName, entries, i, count);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errors.push(e);
|
errors.push(errorToJson(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadedCount += count;
|
loadedCount += count;
|
||||||
|
@ -643,9 +643,9 @@ async function onDictionaryImport(e) {
|
|||||||
await settingsSaveOptions();
|
await settingsSaveOptions();
|
||||||
|
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
errors.push(...errors);
|
const errors2 = errors.map((error) => jsonToError(error));
|
||||||
errors.push(`Dictionary may not have been imported properly: ${errors.length} error${errors.length === 1 ? '' : 's'} reported.`);
|
errors2.push(`Dictionary may not have been imported properly: ${errors2.length} error${errors2.length === 1 ? '' : 's'} reported.`);
|
||||||
dictionaryErrorsShow(errors);
|
dictionaryErrorsShow(errors2);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDatabaseUpdated();
|
onDatabaseUpdated();
|
||||||
|
Loading…
Reference in New Issue
Block a user