- await fetch(url)
- .then(response => response.text())
- .then(html => {
- html = html.replace('Nominatim_API_Endpoint', get_config_value('Nominatim_API_Endpoint'));
- dom_element.innerHTML = html;
- fetch_content_cache[url] = html;
- });
+ try {
+ await fetch(url)
+ .then(response => response.text())
+ .then(html => {
+ html = html.replace('Nominatim_API_Endpoint', Nominatim_Config.Nominatim_API_Endpoint);
+ dom_element.innerHTML = html;
+ fetch_content_cache[url] = html;
+ });
+ } catch (error) {
+ dom_element.innerHTML = `Error fetching content from ${url} (${error})`;
+ }