-
Notifications
You must be signed in to change notification settings - Fork 242
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
Error Response Body being discarded #476
Comments
@TCap103 : would you mind letting us know which API(s) you are working with that are returning an |
I am seeing this when sending a v2 event and payload with Code: https://github.com/moov-io/achgateway/blob/master/internal/alerting/pagerduty.go#L32 Edit: Should we use Edit2: I'm seeing the DebugFlag options, but am not finding a response body or v2 error response. Is there a better option to get full details why a v2 event couldn't be created? Sometimes I was able to get a
|
@adamdecaf : did you see improvement here after the introduction of this PR into v1.6.0 and beyond? |
I am using 1.8.0 and seeing the same, in my case I was letting
The first line is the body dump of the response, the following line the content of err printed as a plain string. Edit: I also tried unwrapping the error and got:
|
When using
ManageEventWithContext
if there is a response error we only get the error code and the high level error message back. For example: "HTTP response failed with status code 400 and no JSON error object was present".From inspecting with curl I know there actually is a detailed error message. It appears that the APIError that we're attempting to decode into in
client.getErrorFromResponse
expects the response.Body to have the json keyerror
however the body is actually (in my test example):{"errors":["'payload.source' is missing or blank"],"message":"Event object is invalid","status":"invalid event"}
I do not know if
doWithEndpoint
's other usages suffer from the same issue, or actually match the currently implemented behavior as I do not use those flows.Currently working around this by using the debug methods to decode the response properly in my own code.
The text was updated successfully, but these errors were encountered: