+ try {
+ await fetch(api_url, { headers: Nominatim_Config.Nominatim_API_Endpoint_Headers || {} })
+ .then(response => response.json())
+ .then(data => {
+ if (data.error) {
+ error_store.set(data.error.message);
+ }
+ callback(data);
+ api_request_progress('finish');
+ });
+ } catch (error) {
+ error_store.set(`Error fetching data from ${api_url} (${error})`);
+ api_request_progress('finish');
+ }