aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
diff options
context:
space:
mode:
authorAlexandre Garand <alexandre.garand@fretlink.com>2019-08-09 15:59:15 +0200
committerAlexandre Garand <alexandre.garand@fretlink.com>2019-08-09 16:39:21 +0200
commit863486a6b71ed0e562a3965bed56465d007b1418 (patch)
treee93f6a687695af86d54237ec9f575d4ef104222d /vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
parent49c1c7b4dc69ffb9ab52330e6dc52ccdd6351087 (diff)
downloadterraform-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/aws/awserr/types.go')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go31
1 files changed, 29 insertions, 2 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
index 0202a00..9cf7eaf 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
@@ -1,6 +1,9 @@
1package awserr 1package awserr
2 2
3import "fmt" 3import (
4 "encoding/hex"
5 "fmt"
6)
4 7
5// SprintError returns a string of the formatted error code. 8// SprintError returns a string of the formatted error code.
6// 9//
@@ -119,6 +122,7 @@ type requestError struct {
119 awsError 122 awsError
120 statusCode int 123 statusCode int
121 requestID string 124 requestID string
125 bytes []byte
122} 126}
123 127
124// newRequestError returns a wrapped error with additional information for 128// newRequestError returns a wrapped error with additional information for
@@ -170,6 +174,29 @@ func (r requestError) OrigErrs() []error {
170 return []error{r.OrigErr()} 174 return []error{r.OrigErr()}
171} 175}
172 176
177type unmarshalError struct {
178 awsError
179 bytes []byte
180}
181
182// Error returns the string representation of the error.
183// Satisfies the error interface.
184func (e unmarshalError) Error() string {
185 extra := hex.Dump(e.bytes)
186 return SprintError(e.Code(), e.Message(), extra, e.OrigErr())
187}
188
189// String returns the string representation of the error.
190// Alias for Error to satisfy the stringer interface.
191func (e unmarshalError) String() string {
192 return e.Error()
193}
194
195// Bytes returns the bytes that failed to unmarshal.
196func (e unmarshalError) Bytes() []byte {
197 return e.bytes
198}
199
173// An error list that satisfies the golang interface 200// An error list that satisfies the golang interface
174type errorList []error 201type errorList []error
175 202
@@ -181,7 +208,7 @@ func (e errorList) Error() string {
181 // How do we want to handle the array size being zero 208 // How do we want to handle the array size being zero
182 if size := len(e); size > 0 { 209 if size := len(e); size > 0 {
183 for i := 0; i < size; i++ { 210 for i := 0; i < size; i++ {
184 msg += fmt.Sprintf("%s", e[i].Error()) 211 msg += e[i].Error()
185 // We check the next index to see if it is within the slice. 212 // We check the next index to see if it is within the slice.
186 // If it is, then we append a newline. We do this, because unit tests 213 // If it is, then we append a newline. We do this, because unit tests
187 // could be broken with the additional '\n' 214 // could be broken with the additional '\n'