diff --git a/lib/src/Components/Map/hooks/useGeoDistance.tsx b/lib/src/Components/Map/hooks/useGeoDistance.tsx index 4b69fd63..2f25f8e7 100644 --- a/lib/src/Components/Map/hooks/useGeoDistance.tsx +++ b/lib/src/Components/Map/hooks/useGeoDistance.tsx @@ -47,7 +47,7 @@ export const useGeoDistance = (targetPoint?: Point) => { if (err instanceof Error) { setError(err.message) } else { - setError('Calculation error') + throw err } } }, [myProfile, isMyProfileLoaded, targetPoint]) diff --git a/lib/src/Components/Map/hooks/useReverseGeocode.ts b/lib/src/Components/Map/hooks/useReverseGeocode.ts index 87c11a26..fd88daed 100644 --- a/lib/src/Components/Map/hooks/useReverseGeocode.ts +++ b/lib/src/Components/Map/hooks/useReverseGeocode.ts @@ -92,10 +92,10 @@ export function useReverseGeocode( } catch (err) { if (err instanceof Error) { setError(err.message) + setAddress('') } else { - setError('Unknown error occurred') + throw err } - setAddress('') } finally { setLoading(false) }