react-native-google-places-autocomplete
react-native-google-places-autocomplete copied to clipboard
Surface non-200 request errors
Currently, if a request to the Google Places API fails with a non-200 status code, there is no console warning, and the onFail callback is not called. This PR fixes that, so that the errors can be surfaced.
An example case is if requestUrl uses the Google API without a proxy, or if the proxy does not have allow-origin CORS headers, then the request fails with a 403, forbidden status. Currently, those cases fail silently, so this PR fixes that, allowing users to specify an error handler and surface the error.
+1, would like the ability to pass an onFail prop that will be called if non-200 is returned! @FaridSafi