Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZERO_RESULTS not an error #115

Closed
ewgRa opened this issue Oct 18, 2017 · 3 comments
Closed

ZERO_RESULTS not an error #115

ewgRa opened this issue Oct 18, 2017 · 3 comments

Comments

@ewgRa
Copy link
Contributor

ewgRa commented Oct 18, 2017

For now, when geocoding request have response status ZERO_RESULTS, it is considered as error.

Looks really strange, since it is not an error.
On such response status my service will response 204 for example.
When status 'OK' - then just response 200
In another cases it is really error and I want log it and response 500

I see only one way to achieve it - 'if err != nil && err == "maps: ZERO_RESULTS - "' and it is really ugly.

I have call "result, err := c.Geocode(context.Background(), r)". Any idea how to make it not so ugly?

For me more natural looks PR to Geocode func, that will check if response status "ZERO_RESULTS", than just return empty results. Is such PR have change to be merged, since it will broke backward compatibility?

@domesticmouse
Copy link
Contributor

Please raise a PR, I'll merge it.

@ewgRa
Copy link
Contributor Author

ewgRa commented Oct 19, 2017

PR done #116

@domesticmouse
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants