File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments