Catch all geocoding exceptions

Close #1381
This commit is contained in:
MM20 2025-06-29 18:19:58 +02:00
parent 6305d974eb
commit 85bfd9d79a
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -30,7 +30,7 @@ internal abstract class GeocoderWeatherProvider(
withContext(Dispatchers.IO) {
try {
geocoder.getFromLocationName(query, 10)
} catch (e: IOException) {
} catch (e: Exception) {
CrashReporter.logException(e)
emptyList()
}
@ -51,7 +51,7 @@ internal abstract class GeocoderWeatherProvider(
Geocoder(context).getFromLocation(lat, lon, 1)
?.firstOrNull()
?.formatToString() ?: formatLatLon(lat, lon)
} catch (e: IOException) {
} catch (e: Exception) {
CrashReporter.logException(e)
formatLatLon(lat, lon)
}