Package: awserr
Overview
Package awserr represents API error interface accessors for the SDK.
Interface Summary collapse
-
BatchError
interface
BatchError is a batch of errors which also wraps lower level errors with code, message, and original errors.
-
BatchedErrors
interface
BatchedErrors is a batch of errors which also wraps lower level errors with code, message, and original errors.
-
Error
interface
An Error wraps lower level errors with code, message and an original error.
-
RequestFailure
interface
A RequestFailure is an interface to extract request failure information from an Error such as the request ID of the failed request returned by a service.
-
UnmarshalError
interface
UnmarshalError provides the interface for the SDK failing to unmarshal data.
Function Summary collapse
-
func New(code, message string, origErr error) Error
New returns an Error object described by the code, message, and origErr.
-
func NewBatchError(code, message string, errs []error) BatchedErrors
NewBatchError returns an BatchedErrors with a collection of errors as an array of errors.
-
func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure
NewRequestFailure returns a wrapped error with additional information for request status code, and service requestID.
-
func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError
NewUnmarshalError returns an initialized UnmarshalError error wrapper adding the bytes that fail to unmarshal to the error.
-
func SprintError(code, message, extra string, origErr error) string
SprintError returns a string of the formatted error code.
Function Details
func New(code, message string, origErr error) Error
New returns an Error object described by the code, message, and origErr.
If origErr satisfies the Error interface it will not be wrapped within a new Error object and will instead be returned.
80 81 82 83 84 85 86 |
// File 'aws/awserr/error.go', line 80
|
func NewBatchError(code, message string, errs []error) BatchedErrors
NewBatchError returns an BatchedErrors with a collection of errors as an array of errors.
90 91 92 |
// File 'aws/awserr/error.go', line 90
|
func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure
NewRequestFailure returns a wrapped error with additional information for request status code, and service requestID.
Should be used to wrap all request which involve service requests. Even if the request failed without a service response, but had an HTTP status code that may be meaningful.
144 145 146 |
// File 'aws/awserr/error.go', line 144
|
func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError
NewUnmarshalError returns an initialized UnmarshalError error wrapper adding the bytes that fail to unmarshal to the error.
156 157 158 159 160 161 |
// File 'aws/awserr/error.go', line 156
|
func SprintError(code, message, extra string, origErr error) string
SprintError returns a string of the formatted error code.
Both extra and origErr are optional. If they are included their lines will be added, but if they are not included their lines will be ignored.
11 12 13 14 15 16 17 18 19 20 |
// File 'aws/awserr/types.go', line 11
|