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

Invalid API key does not return any error when calling Enqueue() #73

Open
mbn18 opened this issue Sep 4, 2024 · 0 comments · May be fixed by #78
Open

Invalid API key does not return any error when calling Enqueue() #73

mbn18 opened this issue Sep 4, 2024 · 0 comments · May be fixed by #78

Comments

@mbn18
Copy link

mbn18 commented Sep 4, 2024

I expect an Error when a Client is created with a bad apiKey. but none return when I call Enqueue()

	err := f.cli.Enqueue(posthog.Capture{
		DistinctId: user.GetDistinctId(),
		Event:      "$set",
		Properties: map[string]interface{}{
			"$set": user.GetMap(),
		},
	})

On bad apiKey nothing happens. The user is created when it is correct.

Also tried to set Callback in the Config, but it executed the Success(message posthog.APIMessage) implementation.

type Callback struct {}

func (m Callback) Success(message posthog.APIMessage) {
	println(fmt.Sprintf("----message\n%v", message))
}

func (m Callback) Failure(message posthog.APIMessage, err error) {
	println(fmt.Sprintf("----message\n%v", message))
	println(fmt.Sprintf("----error\n%s", err.Error()))
}

Is it possible to get an error when the apiKey is wrong? or maybe its a bug?

@dmarticus dmarticus linked a pull request Oct 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant