diff options
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r-- | ext/bg/js/database.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 2f624189..5aee2311 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -332,9 +332,10 @@ class Database { return result; } - async importDictionary(archive, progressCallback, exceptions, details) { + async importDictionary(archive, progressCallback, details) { this.validate(); + const errors = []; const prefixWildcardsSupported = details.prefixWildcardsSupported; const maxTransactionLength = 1000; @@ -351,11 +352,7 @@ class Database { const objectStore = transaction.objectStore(objectStoreName); await Database.bulkAdd(objectStore, items, i, count); } catch (e) { - if (exceptions) { - exceptions.push(e); - } else { - throw e; - } + errors.push(e); } } }; @@ -496,7 +493,7 @@ class Database { await bulkAdd('tagMeta', rows, total, current); }; - return await Database.importDictionaryZip( + const result = await Database.importDictionaryZip( archive, indexDataLoaded, termDataLoaded, @@ -506,6 +503,8 @@ class Database { tagDataLoaded, details ); + + return {result, errors}; } validate() { |