Code Monkey home page Code Monkey logo

Comments (7)

domesticmouse avatar domesticmouse commented on May 19, 2024

Please feel free to sketch out an initial implementation of how errors should be propagated. I'll happily take input on how to improve this library.

/cc @samthor who has a lot more knowledge of how Go code should be written than I.

from google-maps-services-go.

samthor avatar samthor commented on May 19, 2024

There's two approaches I suppose. Either define different Err... objects that are returned, e.g. ErrOverQueryLimit, or add helper methods:

  if maps.IsOverQueryError(returnedErr) {
    ..
  }

from google-maps-services-go.

peergynt avatar peergynt commented on May 19, 2024

@ebati have you made any progress on this issue?

I too would be interested in a more consistent error handling.
For instance, the Places API implementation still treats ZERO_RESULTS as an error.

I was personally thinking that ZERO_RESULTS should not return an error but an empty response (per the API docs: ZERO_RESULTS indicates that the search was successful but returned no results).
It would be nice to be able to differentiate between the other errors without having to compare the error string!

I could take a stab at it if it helps.

from google-maps-services-go.

ebati avatar ebati commented on May 19, 2024

Since we moved to a different provider, i didnt use this library so i couldnt make time to work on this. I should have noted here. Sorry for thatπŸ˜“

from google-maps-services-go.

superstas avatar superstas commented on May 19, 2024

@peergynt it would be great if you could send a PR with a consistent ZERO_RESULTS handling approach.
It'd help us a lot.

Thx!

from google-maps-services-go.

stale avatar stale commented on May 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

from google-maps-services-go.

stale avatar stale commented on May 19, 2024

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

from google-maps-services-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.