Skip to content
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

Merged
merged 2 commits into from Sep 6, 2018
Merged

Conversation

xibz
Copy link
Contributor

@xibz xibz commented Sep 5, 2018

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.

…f a serialization error occurred during unmarshaling
@xibz xibz requested a review from jasdel September 5, 2018 22:07
Copy link
Contributor

@jasdel jasdel left a 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,
"",
Copy link
Contributor

@jasdel jasdel Sep 5, 2018

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.

Copy link

@Aloha106 Aloha106 left a 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"

@xibz xibz merged commit 3a5f3a5 into aws:master Sep 6, 2018
@awstools awstools mentioned this pull request Sep 6, 2018
@xibz xibz deleted the error branch September 10, 2018 20:42
usrenmae pushed a commit to usrenmae/aws-sdk-go that referenced this pull request Sep 23, 2018
* 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
xibz added a commit to xibz/aws-sdk-go that referenced this pull request Oct 15, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants