fix(calendar): use shared errorMessage() for PST import errors
Tauri commands reject with a {kind, message} object, not a native Error,
so `e instanceof Error ? e.message : String(e)` always fell through to
String(e) -> "[object Object]", hiding the actual readpst failure reason.
This commit is contained in:
1 parent
43497ca8cd
commit
66aae232c5
1 file changed
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Imported calendar events (Phase 6, FR-CAL-*). Svelte 5 runes store, same
|
||||
// shape as settings.svelte.ts/meetings.svelte.ts.
|
||||
|
||||
import { api, events, type CalendarEvent } from "../api";
|
||||
import { api, errorMessage, events, type CalendarEvent } from "../api";
|
||||
|
||||
class CalendarStore {
|
||||
events = $state<CalendarEvent[]>([]);
|
||||
@@ -30,7 +30,7 @@ class CalendarStore {
|
||||
await api.importPst(path, password);
|
||||
await this.load();
|
||||
} catch (e) {
|
||||
this.importError = e instanceof Error ? e.message : String(e);
|
||||
this.importError = errorMessage(e);
|
||||
} finally {
|
||||
this.importing = false;
|
||||
this.importProgress = null;
|
||||
|
||||
Reference in new issue
Block a user