-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Integration and debugging would be easier if the package decoded the error messages returned from the Amplitude API and included these messages in the logs, or simply logged the JSON text verbatim without unmarshaling it.
Currently, if you make a mistake tracking an event, you see something like this in your logs:
[00] amplitude-analytics2022/09/07 17:40:05 Info: HTTP request response%!(EXTRA *http.Response=&{400 Bad Request 400 HTTP/2.0 2 0 map[Access-Control-Allow-Methods:[GET, POST] Access-Control-Allow-Origin:[*] Content-Length:[115] Content-Type:[application/json] Date:[Wed, 07 Sep 2022 22:40:05 GMT] Strict-Transport-Security:[max-age=15768000] Trace-Id:[Root=1-63191dc5-2c964e046f02f68c1df60a75]] 0x140000b96a0 79 [] false false map[] 0x1400050a200 0x14000138580})
But the actual HTTP response looks something like this:
{
"code": 400,
"events_with_invalid_id_lengths": {
"user_id": [
0
]
},
"error": "Invalid id length for user_id or device_id"
}
It would be nice to be able to see this error message “Invalid id length for user_id or device_id” logged.