Skip to content

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

@mbn18

Description

@mbn18

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions