fix: add console.warn logging when setup status check fails

Logs a warning when the initial setup status request fails, allowing
operators to diagnose issues during the setup phase. The form remains
visible while the error is logged for debugging purposes.
This commit is contained in:
2026-03-20 13:44:21 +01:00
parent 250bb1a2e5
commit 3568e9caf3

View File

@@ -20,7 +20,7 @@ export interface UseSetupResult {
/** User-facing error message from the last status check. */
error: string | null;
/** Refresh the setup status from the backend. */
refresh: () => void;
refresh: () => Promise<void>;
/** Whether a submit request is currently in flight. */
submitting: boolean;
/** User-facing error message from the last submit attempt. */
@@ -44,7 +44,9 @@ export function useSetup(): UseSetupResult {
const resp = await getSetupStatus();
setStatus(resp);
} catch (err: unknown) {
setError(err instanceof Error ? err.message : "Failed to fetch setup status");
const errorMessage = err instanceof Error ? err.message : "Failed to fetch setup status";
console.warn("Setup status check failed:", errorMessage);
setError(errorMessage);
} finally {
setLoading(false);
}