fix(map): show HTTP status code in error message for easier debugging

This commit is contained in:
ralksta
2026-03-13 12:31:21 +01:00
parent 60b86b540f
commit c610ad2a7d

View File

@@ -35,7 +35,10 @@ export function MapView() {
// Fetch map data // Fetch map data
const res = await fetch('/api/map'); const res = await fetch('/api/map');
if (!res.ok) { if (!res.ok) {
setError('Failed to load map data'); let detail = '';
try { detail = await res.text(); } catch { /* ignore */ }
console.error('[Map] API error', res.status, detail);
setError(`Failed to load map data (${res.status})`);
setLoading(false); setLoading(false);
return; return;
} }