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 1c0bac1353
commit 52b0936200

View File

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