fix(map): show HTTP status code in error message for easier debugging
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user