{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/438","labels_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/438/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/438/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/438/events","html_url":"https://github.com/aws/aws-sdk-go/pull/438","id":117129955,"number":438,"title":"Use custom unmarshalError handler for Route53","user":{"login":"abustany","id":2526296,"avatar_url":"https://avatars.githubusercontent.com/u/2526296?v=3","gravatar_id":"","url":"https://api.github.com/users/abustany","html_url":"https://github.com/abustany","followers_url":"https://api.github.com/users/abustany/followers","following_url":"https://api.github.com/users/abustany/following{/other_user}","gists_url":"https://api.github.com/users/abustany/gists{/gist_id}","starred_url":"https://api.github.com/users/abustany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abustany/subscriptions","organizations_url":"https://api.github.com/users/abustany/orgs","repos_url":"https://api.github.com/users/abustany/repos","events_url":"https://api.github.com/users/abustany/events{/privacy}","received_events_url":"https://api.github.com/users/abustany/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-go/labels/feedback%20requested","name":"feedback requested","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-16T14:01:17Z","updated_at":"2015-12-16T22:40:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/438","html_url":"https://github.com/aws/aws-sdk-go/pull/438","diff_url":"https://github.com/aws/aws-sdk-go/pull/438.diff","patch_url":"https://github.com/aws/aws-sdk-go/pull/438.patch"},"body":"Certains Route53 calls like ChangeResourceRecordSets will return\r\nspecific error types, so we need a custom handler to take those into\r\naccount.\r\n\r\n\r\nOpen questions:\r\n- The current `awserr.Error` type doesn't account for \"composite\" errors, so for now I just join the messages with \\n... Is there a better way to solve that issue?\r\n- Due to the API of private/protocol/query, I had to copy paste the unmarshalling for standard XML errors. One option would be to add a `UnmarshalErrorFromData(statusCode int, body []byte) error` function there."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/comments/165276462","html_url":"https://github.com/aws/aws-sdk-go/pull/438#issuecomment-165276462","issue_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/438","id":165276462,"user":{"login":"jasdel","id":961963,"avatar_url":"https://avatars.githubusercontent.com/u/961963?v=3","gravatar_id":"","url":"https://api.github.com/users/jasdel","html_url":"https://github.com/jasdel","followers_url":"https://api.github.com/users/jasdel/followers","following_url":"https://api.github.com/users/jasdel/following{/other_user}","gists_url":"https://api.github.com/users/jasdel/gists{/gist_id}","starred_url":"https://api.github.com/users/jasdel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasdel/subscriptions","organizations_url":"https://api.github.com/users/jasdel/orgs","repos_url":"https://api.github.com/users/jasdel/repos","events_url":"https://api.github.com/users/jasdel/events{/privacy}","received_events_url":"https://api.github.com/users/jasdel/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T22:40:59Z","updated_at":"2015-12-16T22:40:59Z","body":"Thanks for the update @abustany. The benefit of using the `ByteReadCloser` type is the SDK's unmarshaller could rewind the body when multiple parsing attempts is needed for the body. Specifically this occurs when the request fails, and an error response is returned. Specifically like in this case where the error could be of multiple types.\r\n\r\n#331 highlights this issue where multiple error unmarshalling are helpful."}}