fix(oxibadge): show connection errors instead of failing silently
Check, format and test / build (push) Successful in 10m4s
Check, format and test / build (push) Successful in 10m4s
load_records/load_employees failures were only logged to the console and silently reset the UI to the month picker. Errors now flow through a shared store (src/lib/error.ts) into an ErrorBanner, reused by both Onboarding and ConfirmMonth, with the raw message passed straight through from Rust (no stable-code classification layer — these are mostly plain I/O errors, not worth categorizing). i18n stays grouped per screen as before, with error-related strings split into their own top-level "errors" group. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { _, locale } from 'svelte-i18n';
|
||||
import { monthName } from '$lib/month';
|
||||
import { setError, clearError } from '$lib/error';
|
||||
import Screen from '$lib/components/Screen.svelte';
|
||||
import Onboarding from '$lib/components/Onboarding.svelte';
|
||||
import ConfirmMonth from '$lib/components/ConfirmMonth.svelte';
|
||||
@@ -25,13 +26,14 @@
|
||||
selectedYear = selection.year;
|
||||
selectedMonth = selection.month;
|
||||
step = 'loading-records';
|
||||
clearError();
|
||||
try {
|
||||
const records = await invoke('load_records', selection);
|
||||
step = 'loading-employees';
|
||||
await invoke('load_employees', { records });
|
||||
step = 'done';
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setError(err);
|
||||
step = 'confirm-month';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user