aboutsummaryrefslogtreecommitdiff
path: root/ext/js/dictionary/dictionary-importer.js
diff options
context:
space:
mode:
authorBirudo un <cokoryuu@gmail.com>2024-03-18 20:29:53 +0800
committerGitHub <noreply@github.com>2024-03-18 12:29:53 +0000
commitc26680fd7399e8e1fb5e3c10a3f72f592d59e370 (patch)
treef088a7b06c3ef0440b8aea0d0dff772435a48601 /ext/js/dictionary/dictionary-importer.js
parent7ee76d708934adeef06479f7757beb22c6c01d14 (diff)
feat: support skipping already import dictionaries (#769)
Diffstat (limited to 'ext/js/dictionary/dictionary-importer.js')
-rw-r--r--ext/js/dictionary/dictionary-importer.js5
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