Type caught errors as unknown in the frontend

Replace `catch (e: any)` with `catch (e)` and read the message through a
new errorMessage() helper. ApiError.data gets a real type, and
useDismissingState's setter keeps one identity across renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 11:10:00 +02:00
co-authored by Claude Opus 5.5
parent 958a5a5950
commit 619b5b9a93
55 changed files with 400 additions and 332 deletions
@@ -8,6 +8,7 @@ import { formatDate } from "@/lib/date";
import { useDismissingState } from "@/hooks/useDismissingState";
import { ListChecks, ArrowUp, ArrowDown } from "lucide-react";
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from "@/components/ui/table";
import { errorMessage } from "@/lib/utils";
type Entry = {
id: string;
@@ -67,8 +68,8 @@ export default function WaitlistPage() {
setBusy(true);
try {
setEntries(await apiFetch<Entry[]>(`/api/waitlist/events/${encodeURIComponent(eventId)}`, { authToken: token }));
} catch (e: any) {
setError(e?.message || "Failed to load the waitlist");
} catch (e) {
setError(errorMessage(e) || "Failed to load the waitlist");
} finally {
setBusy(false);
}
@@ -81,8 +82,8 @@ export default function WaitlistPage() {
const res = await apiFetch<{ message?: string }>(path, { method: "POST", authToken: token!, body });
if (res?.message) setInfo(res.message);
await load();
} catch (e: any) {
setError(e?.message || "Something went wrong");
} catch (e) {
setError(errorMessage(e) || "Something went wrong");
} finally {
setBusy(false);
}