From aafa3bb1e455de8dfb74234a36c6a560eb7d73dc Mon Sep 17 00:00:00 2001 From: afiqzudinhadi Date: Thu, 30 Jul 2026 12:49:59 +0800 Subject: [PATCH] fix(watchlist): surface sync command errors via Notice --- packages/obsidian/src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/obsidian/src/main.ts b/packages/obsidian/src/main.ts index 020a958..0982547 100644 --- a/packages/obsidian/src/main.ts +++ b/packages/obsidian/src/main.ts @@ -1,5 +1,5 @@ import 'packages/obsidian/src/styles.css'; -import { Plugin, TFolder } from 'obsidian'; +import { Notice, Plugin, TFolder } from 'obsidian'; import { APIManager } from 'packages/obsidian/src/api/APIManager'; import { BoardGameGeekAPI } from 'packages/obsidian/src/api/apis/BoardGameGeekAPI'; import { ComicVineAPI } from 'packages/obsidian/src/api/apis/ComicVineAPI'; @@ -179,17 +179,17 @@ export default class MediaDbPlugin extends Plugin { this.addCommand({ id: 'watchlist-sync-now', name: 'Watchlist: sync now (airing/active only)', - callback: () => void this.watchlist.syncNow(false), + callback: () => void this.watchlist.syncNow(false).catch((e: unknown) => new Notice(e instanceof Error ? e.message : String(e))), }); this.addCommand({ id: 'watchlist-sync-full', name: 'Watchlist: full sync (all entries)', - callback: () => void this.watchlist.syncNow(true), + callback: () => void this.watchlist.syncNow(true).catch((e: unknown) => new Notice(e instanceof Error ? e.message : String(e))), }); this.addCommand({ id: 'watchlist-sync-dry-run', name: 'Watchlist: dry-run full sync (log only, no writes)', - callback: () => void this.watchlist.syncNow(true, true), + callback: () => void this.watchlist.syncNow(true, true).catch((e: unknown) => new Notice(e instanceof Error ? e.message : String(e))), }); }