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
+3 -2
View File
@@ -7,6 +7,7 @@ import { saveToken } from "@/lib/auth";
import { useSearchParams } from "next/navigation";
import { appName } from "@/lib/siteConfig";
import { ShieldCheck } from "lucide-react";
import { errorMessage } from "@/lib/utils";
function ActivateAccountContent() {
const search = useSearchParams();
@@ -30,8 +31,8 @@ function ActivateAccountContent() {
if (data?.token) saveToken(data.token);
setStatus("Your account is now active. Redirecting…");
setTimeout(() => { window.location.href = "/dashboard"; }, 1500);
} catch (err: any) {
setStatus(err?.message || "Activation failed. The link may have expired.");
} catch (err) {
setStatus(errorMessage(err) || "Activation failed. The link may have expired.");
} finally {
setLoading(false);
}