feat(frontend): integrate error handling into application

App.svelte:
- Import and render ErrorModal component
- Add ErrorModal to main app layout below Header

CheckIfAniListLoggedInAndLoadWatchList.svelte:
- Import error state helpers (setApiError, clearApiError)
- Wrap LoadAniListUser in try-catch with error handling
- Wrap LoadAniListWatchList in try-catch with error handling
- Update CheckIfAniListLoggedInAndLoadWatchList with error handling
- Remove old alert() calls in favor of modal system

Home.svelte:
- Import isApiDown and apiError stores
- Add conditional rendering for API down state
- Display user-friendly "API Unavailable" message when apiError is set
- Show warning icon and helpful messaging

Error handling is now fully integrated across the frontend application.
This commit is contained in:
2026-03-30 20:08:34 -04:00
parent 2c7e2d0eff
commit ae54fd20dd
3 changed files with 93 additions and 27 deletions

View File

@@ -25,6 +25,7 @@
SimklGetUserWatchlist,
} from "../wailsjs/go/main/App";
import { loc } from "svelte-spa-router";
import ErrorModal from "./helperComponents/ErrorModal.svelte";
onMount(async () => {
let isAniListLoggedIn: boolean;
@@ -57,6 +58,7 @@
</script>
<Header />
<ErrorModal />
<Router
routes={{
"/": Home,