@@ -118,11 +118,15 @@ func (b baseError) OrigErrs() []error {
118
118
119
119
// So that the Error interface type can be included as an anonymous field
120
120
// in the requestError struct and not conflict with the error.Error() method.
121
+ //
122
+ //nolint:all
121
123
type cfnError Error
122
124
123
125
// A requestError wraps a request or service error.
124
126
//
125
127
// Composed of baseError for code, message, and original error.
128
+ //
129
+ //nolint:all
126
130
type requestError struct {
127
131
cfnError
128
132
statusCode int
@@ -137,6 +141,8 @@ type requestError struct {
137
141
// that may be meaningful.
138
142
//
139
143
// Also wraps original errors via the baseError.
144
+ //
145
+ //nolint:all
140
146
func newRequestError (err Error , statusCode int , requestID string ) * requestError {
141
147
return & requestError {
142
148
cfnError : err ,
@@ -147,6 +153,8 @@ func newRequestError(err Error, statusCode int, requestID string) *requestError
147
153
148
154
// Error returns the string representation of the error.
149
155
// Satisfies the error interface.
156
+ //
157
+ //nolint:all
150
158
func (r requestError ) Error () string {
151
159
extra := fmt .Sprintf ("status code: %d, request id: %s" ,
152
160
r .statusCode , r .requestID )
@@ -155,22 +163,30 @@ func (r requestError) Error() string {
155
163
156
164
// String returns the string representation of the error.
157
165
// Alias for Error to satisfy the stringer interface.
166
+ //
167
+ //nolint:all
158
168
func (r requestError ) String () string {
159
169
return r .Error ()
160
170
}
161
171
162
172
// StatusCode returns the wrapped status code for the error
173
+ //
174
+ //nolint:all
163
175
func (r requestError ) StatusCode () int {
164
176
return r .statusCode
165
177
}
166
178
167
179
// RequestID returns the wrapped requestID
180
+ //
181
+ //nolint:all
168
182
func (r requestError ) RequestID () string {
169
183
return r .requestID
170
184
}
171
185
172
186
// OrigErrs returns the original errors if one was set. An empty slice is
173
187
// returned if no error was set.
188
+ //
189
+ //nolint:all
174
190
func (r requestError ) OrigErrs () []error {
175
191
if b , ok := r .cfnError .(BatchedErrors ); ok {
176
192
return b .OrigErrs ()
@@ -189,7 +205,7 @@ func (e errorList) Error() string {
189
205
// How do we want to handle the array size being zero
190
206
if size := len (e ); size > 0 {
191
207
for i := 0 ; i < size ; i ++ {
192
- msg += fmt . Sprintf ( "%s" , e [i ].Error () )
208
+ msg += e [i ].Error ()
193
209
// We check the next index to see if it is within the slice.
194
210
// If it is, then we append a newline. We do this, because unit tests
195
211
// could be broken with the additional '\n'
0 commit comments