Skip to content

Commit 667335c

Browse files
committed
fix: potentially fix tentacle issue?
1 parent b276d4a commit 667335c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/maps/api/overpass.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,22 @@ export const getOverpassData = async (
3737
if (!response.ok) {
3838
// Try the fallback, but store the result under the primary URL key so future requests are served from cache without needing to fail-over again.
3939
try {
40-
const fallbackResponse = await fetch(
40+
const fallbackResponse = await cacheFetch(
4141
`${OVERPASS_API_FALLBACK}?data=${encodedQuery}`,
42+
loadingText,
43+
cacheType,
4244
);
4345
if (fallbackResponse.ok) {
4446
const cache = await determineCache(cacheType);
4547
await cache.put(primaryUrl, fallbackResponse.clone());
4648
}
4749
response = fallbackResponse;
4850
} catch {
49-
/* empty */
51+
toast.error(
52+
`Could not load data from Overpass: ${response.status} ${response.statusText}`,
53+
{ toastId: "overpass-error" },
54+
);
55+
return { elements: [] };
5056
}
5157
}
5258

0 commit comments

Comments
 (0)