diff --git a/src/main/assistant/assistant-database.ts b/src/main/assistant/assistant-database.ts index 90c976c7..ee70bdbb 100644 --- a/src/main/assistant/assistant-database.ts +++ b/src/main/assistant/assistant-database.ts @@ -4186,7 +4186,9 @@ export class AssistantDatabase { VALUES (?, ?, ?, ?, ?)` ).run(id, input.name, key, now, now) } catch (error) { - if (error instanceof Error && error.message.includes('UNIQUE')) throw new Error('标签已存在') + if (error instanceof Error && error.message.includes('UNIQUE')) { + throw new Error('标签已存在', { cause: error }) + } throw error } this.options.onMagicNotesChanged?.()