Fix reverse geocoder error handling

pull/1376/head
Alex Baker 3 years ago
parent e2436414eb
commit 0b0177e608

@ -241,14 +241,14 @@ class LocationPickerActivity : InjectingAppCompatActivity(), Toolbar.OnMenuItemC
fun selectLocation() { fun selectLocation() {
val mapPosition = map.mapPosition ?: return val mapPosition = map.mapPosition ?: return
loadingIndicator.visibility = View.VISIBLE loadingIndicator.visibility = View.VISIBLE
try { lifecycleScope.launch {
lifecycleScope.launch { try {
returnPlace(geocoder.reverseGeocode(mapPosition) ?: newPlace(mapPosition)) returnPlace(geocoder.reverseGeocode(mapPosition) ?: newPlace(mapPosition))
} catch (e: Exception) {
loadingIndicator.visibility = View.GONE
firebase.reportException(e)
toaster.longToast(e.message)
} }
} catch (e: Exception) {
loadingIndicator.visibility = View.GONE
firebase.reportException(e)
toaster.longToast(e.message)
} }
} }

Loading…
Cancel
Save