diff options
author | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 15:59:15 +0200 |
---|---|---|
committer | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 16:39:21 +0200 |
commit | 863486a6b71ed0e562a3965bed56465d007b1418 (patch) | |
tree | e93f6a687695af86d54237ec9f575d4ef104222d /vendor/github.com/aws/aws-sdk-go/private/protocol/query | |
parent | 49c1c7b4dc69ffb9ab52330e6dc52ccdd6351087 (diff) | |
download | terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.gz terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.zst terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.zip |
update vendor and go.modadd_contact_groups
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/private/protocol/query')
3 files changed, 38 insertions, 43 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go index 60e5b09..0cb99eb 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go | |||
@@ -21,7 +21,7 @@ func Build(r *request.Request) { | |||
21 | "Version": {r.ClientInfo.APIVersion}, | 21 | "Version": {r.ClientInfo.APIVersion}, |
22 | } | 22 | } |
23 | if err := queryutil.Parse(body, r.Params, false); err != nil { | 23 | if err := queryutil.Parse(body, r.Params, false); err != nil { |
24 | r.Error = awserr.New("SerializationError", "failed encoding Query request", err) | 24 | r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err) |
25 | return | 25 | return |
26 | } | 26 | } |
27 | 27 | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go index 3495c73..f69c1ef 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go | |||
@@ -24,7 +24,7 @@ func Unmarshal(r *request.Request) { | |||
24 | err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") | 24 | err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") |
25 | if err != nil { | 25 | if err != nil { |
26 | r.Error = awserr.NewRequestFailure( | 26 | r.Error = awserr.NewRequestFailure( |
27 | awserr.New("SerializationError", "failed decoding Query response", err), | 27 | awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err), |
28 | r.HTTPResponse.StatusCode, | 28 | r.HTTPResponse.StatusCode, |
29 | r.RequestID, | 29 | r.RequestID, |
30 | ) | 30 | ) |
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go index 46d354e..831b011 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go | |||
@@ -2,73 +2,68 @@ package query | |||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "encoding/xml" | 4 | "encoding/xml" |
5 | "io/ioutil" | 5 | "fmt" |
6 | 6 | ||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | 7 | "github.com/aws/aws-sdk-go/aws/awserr" |
8 | "github.com/aws/aws-sdk-go/aws/request" | 8 | "github.com/aws/aws-sdk-go/aws/request" |
9 | "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" | ||
9 | ) | 10 | ) |
10 | 11 | ||
12 | // UnmarshalErrorHandler is a name request handler to unmarshal request errors | ||
13 | var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} | ||
14 | |||
11 | type xmlErrorResponse struct { | 15 | type xmlErrorResponse struct { |
12 | XMLName xml.Name `xml:"ErrorResponse"` | 16 | Code string `xml:"Error>Code"` |
13 | Code string `xml:"Error>Code"` | 17 | Message string `xml:"Error>Message"` |
14 | Message string `xml:"Error>Message"` | 18 | RequestID string `xml:"RequestId"` |
15 | RequestID string `xml:"RequestId"` | ||
16 | } | 19 | } |
17 | 20 | ||
18 | type xmlServiceUnavailableResponse struct { | 21 | type xmlResponseError struct { |
19 | XMLName xml.Name `xml:"ServiceUnavailableException"` | 22 | xmlErrorResponse |
20 | } | 23 | } |
21 | 24 | ||
22 | // UnmarshalErrorHandler is a name request handler to unmarshal request errors | 25 | func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { |
23 | var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} | 26 | const svcUnavailableTagName = "ServiceUnavailableException" |
27 | const errorResponseTagName = "ErrorResponse" | ||
28 | |||
29 | switch start.Name.Local { | ||
30 | case svcUnavailableTagName: | ||
31 | e.Code = svcUnavailableTagName | ||
32 | e.Message = "service is unavailable" | ||
33 | return d.Skip() | ||
34 | |||
35 | case errorResponseTagName: | ||
36 | return d.DecodeElement(&e.xmlErrorResponse, &start) | ||
37 | |||
38 | default: | ||
39 | return fmt.Errorf("unknown error response tag, %v", start) | ||
40 | } | ||
41 | } | ||
24 | 42 | ||
25 | // UnmarshalError unmarshals an error response for an AWS Query service. | 43 | // UnmarshalError unmarshals an error response for an AWS Query service. |
26 | func UnmarshalError(r *request.Request) { | 44 | func UnmarshalError(r *request.Request) { |
27 | defer r.HTTPResponse.Body.Close() | 45 | defer r.HTTPResponse.Body.Close() |
28 | 46 | ||
29 | bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body) | 47 | var respErr xmlResponseError |
48 | err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body) | ||
30 | if err != nil { | 49 | if err != nil { |
31 | r.Error = awserr.NewRequestFailure( | 50 | r.Error = awserr.NewRequestFailure( |
32 | awserr.New("SerializationError", "failed to read from query HTTP response body", err), | 51 | awserr.New(request.ErrCodeSerialization, |
52 | "failed to unmarshal error message", err), | ||
33 | r.HTTPResponse.StatusCode, | 53 | r.HTTPResponse.StatusCode, |
34 | r.RequestID, | 54 | r.RequestID, |
35 | ) | 55 | ) |
36 | return | 56 | return |
37 | } | 57 | } |
38 | 58 | ||
39 | // First check for specific error | 59 | reqID := respErr.RequestID |
40 | resp := xmlErrorResponse{} | 60 | if len(reqID) == 0 { |
41 | decodeErr := xml.Unmarshal(bodyBytes, &resp) | 61 | reqID = r.RequestID |
42 | if decodeErr == nil { | ||
43 | reqID := resp.RequestID | ||
44 | if reqID == "" { | ||
45 | reqID = r.RequestID | ||
46 | } | ||
47 | r.Error = awserr.NewRequestFailure( | ||
48 | awserr.New(resp.Code, resp.Message, nil), | ||
49 | r.HTTPResponse.StatusCode, | ||
50 | reqID, | ||
51 | ) | ||
52 | return | ||
53 | } | ||
54 | |||
55 | // Check for unhandled error | ||
56 | servUnavailResp := xmlServiceUnavailableResponse{} | ||
57 | unavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp) | ||
58 | if unavailErr == nil { | ||
59 | r.Error = awserr.NewRequestFailure( | ||
60 | awserr.New("ServiceUnavailableException", "service is unavailable", nil), | ||
61 | r.HTTPResponse.StatusCode, | ||
62 | r.RequestID, | ||
63 | ) | ||
64 | return | ||
65 | } | 62 | } |
66 | 63 | ||
67 | // Failed to retrieve any error message from the response body | ||
68 | r.Error = awserr.NewRequestFailure( | 64 | r.Error = awserr.NewRequestFailure( |
69 | awserr.New("SerializationError", | 65 | awserr.New(respErr.Code, respErr.Message, nil), |
70 | "failed to decode query XML error response", decodeErr), | ||
71 | r.HTTPResponse.StatusCode, | 66 | r.HTTPResponse.StatusCode, |
72 | r.RequestID, | 67 | reqID, |
73 | ) | 68 | ) |
74 | } | 69 | } |