analytics-go icon indicating copy to clipboard operation
analytics-go copied to clipboard

No error returned on empty or invalid write-key

Open mugdha-adhav opened this issue 4 years ago • 1 comments

If I set an empty or invalid write key while creating a client, it doesn't return any error. Everything goes through and no error is logged.

I tried creating client with both the below methods

1. client := analytics.New(c.Key)
2. client, err := analytics.NewWithConfig(c.Key, analytics.Config{})

But no error is returned even while calling client.Enqueue() or client.Close()

Shouldn't the code return an error if data is not received in Segment? Or even when the client creation is incorrect.

It's assumed that data is sent unless you verify it manually, which is misleading.

mugdha-adhav avatar Jul 30 '20 11:07 mugdha-adhav

@mugdha-adhav I am also getting the same issue. Not getting any error on sending empty or invalid write key and I am getting response 200 OK in return. How you have tackled this case?

HimanshuS01 avatar Aug 09 '21 12:08 HimanshuS01