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
private/protocol: wrapping serialization errors #2135
Conversation
…f a serialization error occurred during unmarshaling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change looks good. Just need to populate the RequestId portion of the RequestFailure.
r.Error = awserr.NewRequestFailure( | ||
awserr.New("SerializationError", "failed decoding EC2 Query response", err), | ||
r.HTTPResponse.StatusCode, | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to populate the RequestID
field for these errors. This can be obtained from r.RequestID i think, but need to make sure. The r.RequestID
should of been populated from the UnmarshalMeta
handler list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also change private/protocol/query/unmarshal_error.go?
see below
- "SQS ReceiveMessages request returned error: SerializationError: failed to decode query XML error response caused by: EOF"
* serialization errors will now be wrapped as a request failure error if a serialization error occurred during unmarshaling * adding request ID to request failure errors
* serialization errors will now be wrapped as a request failure error if a serialization error occurred during unmarshaling * adding request ID to request failure errors
This change will allow serialization errors that were being returned during unmarshaling to be wrapped in a
awserr.RequestFailure
instead. This allows for custom retryers to get at the status code more easily.