diff options
author | Birudo un <cokoryuu@gmail.com> | 2024-03-18 20:29:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 12:29:53 +0000 |
commit | c26680fd7399e8e1fb5e3c10a3f72f592d59e370 (patch) | |
tree | f088a7b06c3ef0440b8aea0d0dff772435a48601 /ext/js/dictionary | |
parent | 7ee76d708934adeef06479f7757beb22c6c01d14 (diff) |
feat: support skipping already import dictionaries (#769)
Diffstat (limited to 'ext/js/dictionary')
-rw-r--r-- | ext/js/dictionary/dictionary-importer.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/js/dictionary/dictionary-importer.js b/ext/js/dictionary/dictionary-importer.js index 16998a8f..310b2ec1 100644 --- a/ext/js/dictionary/dictionary-importer.js +++ b/ext/js/dictionary/dictionary-importer.js @@ -106,7 +106,10 @@ export class DictionaryImporter { // Verify database is not already imported if (await dictionaryDatabase.dictionaryExists(dictionaryTitle)) { - throw new Error('Dictionary is already imported'); + return { + errors: [new Error(`Dictionary ${dictionaryTitle} is already imported, skipped it.`)], + result: null + }; } // Load schemas |