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

Errors ignored in DecodePolyline #142

Closed
rosshemsley opened this issue Apr 24, 2018 · 1 comment
Closed

Errors ignored in DecodePolyline #142

rosshemsley opened this issue Apr 24, 2018 · 1 comment

Comments

@rosshemsley
Copy link

rosshemsley commented Apr 24, 2018

Looks like errors are printed to stderr instead of returned in the polyline decoder:

https://github.com/googlemaps/google-maps-services-go/blob/master/polyline.go#L49

This means it's not possible to tell if the whole polyline was successfully decoded.

A nicer API would be to propagate the errors up (and leave logging to stderr to the caller)

edit: actually this is log.Fatal, so if you try and parse an invalid polyline it will call os.Exit(1) - which seems non-ideal..

domesticmouse added a commit to domesticmouse/google-maps-services-go that referenced this issue May 15, 2018
@domesticmouse
Copy link
Contributor

Merged a fix that exposes failing polyline decodes as an error.

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