fix(watchlist): surface sync command errors via Notice
This commit is contained in:
parent
f9cc324ead
commit
aafa3bb1e4
1 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import 'packages/obsidian/src/styles.css';
|
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 { APIManager } from 'packages/obsidian/src/api/APIManager';
|
||||||
import { BoardGameGeekAPI } from 'packages/obsidian/src/api/apis/BoardGameGeekAPI';
|
import { BoardGameGeekAPI } from 'packages/obsidian/src/api/apis/BoardGameGeekAPI';
|
||||||
import { ComicVineAPI } from 'packages/obsidian/src/api/apis/ComicVineAPI';
|
import { ComicVineAPI } from 'packages/obsidian/src/api/apis/ComicVineAPI';
|
||||||
|
|
@ -179,17 +179,17 @@ export default class MediaDbPlugin extends Plugin {
|
||||||
this.addCommand({
|
this.addCommand({
|
||||||
id: 'watchlist-sync-now',
|
id: 'watchlist-sync-now',
|
||||||
name: 'Watchlist: sync now (airing/active only)',
|
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({
|
this.addCommand({
|
||||||
id: 'watchlist-sync-full',
|
id: 'watchlist-sync-full',
|
||||||
name: 'Watchlist: full sync (all entries)',
|
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({
|
this.addCommand({
|
||||||
id: 'watchlist-sync-dry-run',
|
id: 'watchlist-sync-dry-run',
|
||||||
name: 'Watchlist: dry-run full sync (log only, no writes)',
|
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))),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue