bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.25k stars 197 forks source link

onError will be now also called when there is a route request error. #124

Closed AntonioRedondo closed 4 years ago

AntonioRedondo commented 4 years ago

Hi @bramus,

Just made some small changes so that the onError prop is called when there is a route request error. This is useful when, for example, Google Maps API doesn't found a route between two places and returns a 200 response with geocoder_status: ZERO_RESULTS. Or when the API key is incorrect.

Now with the onError callback always called on every error we can act accordingly like informing the user.

Tell me what you think if you have any feedback. And in case everything is OK feel free to merge changes. 🙂

bramus commented 4 years ago

Hi @AntonioRedondo, thanks for this PR!

As I'm checking it just now, I see that it has the same effect as the changes to improve error handling I've done earlier today. With that change, the onError callback is also called when a request to the Directions API fails.

I appreciate the work you've done here, and am glad to see that we came to the same result. I will however be closing this PR, as it's no longer of use. Thank you for your time.

If I happen to be mistaken in this analysis, feel free to get back to me and I'll gladly reopen.

AntonioRedondo commented 4 years ago

Hey @bramus, no problem. Totally glad the issue was tackled whether it was with your changes or mines. 👍