Source File
errors.go
Belonging Package
github.com/aws/smithy-go/document
package document
import (
)
// UnmarshalTypeError is an error type representing an error
// unmarshaling a Smithy document to a Go value type. This is different
// from UnmarshalError in that it does not wrap an underlying error type.
type UnmarshalTypeError struct {
Value string
Type reflect.Type
}
// Error returns the string representation of the error.
// Satisfying the error interface.
func ( *UnmarshalTypeError) () string {
return fmt.Sprintf("unmarshal failed, cannot unmarshal %s into Go value type %s",
.Value, .Type.String())
}
// An InvalidUnmarshalError is an error type representing an invalid type
// encountered while unmarshaling a Smithy document to a Go value type.
type InvalidUnmarshalError struct {
Type reflect.Type
}
// Error returns the string representation of the error.
// Satisfying the error interface.
func ( *InvalidUnmarshalError) () string {
var string
if .Type == nil {
= "cannot unmarshal to nil value"
} else if .Type.Kind() != reflect.Ptr {
= fmt.Sprintf("cannot unmarshal to non-pointer value, got %s", .Type.String())
} else {
= fmt.Sprintf("cannot unmarshal to nil value, %s", .Type.String())
}
return fmt.Sprintf("unmarshal failed, %s", )
}
// An UnmarshalError wraps an error that occurred while unmarshaling a
// Smithy document into a Go type. This is different from
// UnmarshalTypeError in that it wraps the underlying error that occurred.
type UnmarshalError struct {
Err error
Value string
Type reflect.Type
}
// Unwrap returns the underlying unmarshaling error
func ( *UnmarshalError) () error {
return .Err
}
// Error returns the string representation of the error.
// Satisfying the error interface.
func ( *UnmarshalError) () string {
return fmt.Sprintf("unmarshal failed, cannot unmarshal %q into %s, %v",
.Value, .Type.String(), .Err)
}
// An InvalidMarshalError is an error type representing an error
// occurring when marshaling a Go value type.
type InvalidMarshalError struct {
Message string
}
// Error returns the string representation of the error.
// Satisfying the error interface.
func ( *InvalidMarshalError) () string {
return fmt.Sprintf("marshal failed, %s", .Message)
}
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)