Giter Site home page Giter Site logo

Comments (10)

jcace avatar jcace commented on May 22, 2024 1

thanks! looks like it works now. Tested v2.9.1

Must've been an invalid IP address because I'm getting expected result now. Error message is much better too when I pass in an invalid one.

from go.

UmanShahzad avatar UmanShahzad commented on May 22, 2024

Are you putting a real token and not getting rate limited? Either of these may cause the issue, but please do confirm.

from go.

rm-Umar avatar rm-Umar commented on May 22, 2024

I just checked and I was able to replicate the error if you put an empty string in the client as token then it throws this error

client := ipinfo.NewClient(nil, nil, "")

So putting the token should solve your issue.
cc: @UmanShahzad

from go.

UmanShahzad avatar UmanShahzad commented on May 22, 2024

I see. Can we fix so that it doesn't panic, and instead just returns an error?

from go.

jcace avatar jcace commented on May 22, 2024

I am using my real token - just redacted it for the post:

	client := ipinfo.NewClient(nil, nil, "39b807185xxxxx")

Doesn't seem like I'm being rate limited - brand new account and testing with only a single IP in the request

Screenshot 2022-11-15 at 12 57 31 PM

from go.

rm-Umar avatar rm-Umar commented on May 22, 2024

I see. Can we fix so that it doesn't panic, and instead just returns an error?

I think a simple check on the token can solve this issue.

from go.

rm-Umar avatar rm-Umar commented on May 22, 2024

I am using my real token - just redacted it for the post:

	client := ipinfo.NewClient(nil, nil, "39b807185xxxxx")

Doesn't seem like I'm being rate limited - brand new account and testing with only a single IP in the request

Screenshot 2022-11-15 at 12 57 31 PM

I am unable to replicate this error I've tried different scenarios and the only scenario giving me this error is when you pass "" as token. I also noticed you are using SDK version 2.8.0 you can try updating to 2.9.0 meanwhile I'll look into it further and try to find the cause of this problem.

from go.

rm-Umar avatar rm-Umar commented on May 22, 2024

The error also occurs if we put an invalid IP in the batch request

batchResult, err := client.GetIPInfoBatch(
		[]net.IP{
			net.ParseIP("1.1.1.1"),
			net.ParseIP("8.8.8.8"),
			net.ParseIP(""),
			}

from go.

UmanShahzad avatar UmanShahzad commented on May 22, 2024

Will do a patch release then you can try again.

from go.

rm-Umar avatar rm-Umar commented on May 22, 2024

@jcace just released v2.9.1 your error should be fixed in this patch.
Thank you for your feedback! 😃

from 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.