Documentation ¶
Index ¶
- Constants
- func ResponseHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)
- func ResponseHandlerWithLogger(lvl zerolog.Level) func(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)
- func UnknownOperationHandler(w http.ResponseWriter, r *http.Request)
- type Exception
- func FromError(err error) *Exception
- func NewInternalFailureException(msg string) *Exception
- func NewInternalServerException(msg string) *Exception
- func NewInvalidInputError(msg string) *Exception
- func NewResourceNotFoundError(msg string) *Exception
- func NewSerializationException(msg string) *Exception
- func NewUnauthorizedError(msg string) *Exception
- func NewUnknownOperationException(msg string) *Exception
- func NewValidationError(msg string) *Exception
- type ExceptionType
Constants ¶
View Source
const (
SmithyErrorTypeHeader = "X-Amzn-Errortype"
)
Variables ¶
This section is empty.
Functions ¶
func ResponseHandler ¶
func UnknownOperationHandler ¶
func UnknownOperationHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type Exception ¶
type Exception struct { HttpCode int ExceptionType ExceptionType Message string }
func NewInvalidInputError ¶
func NewUnauthorizedError ¶
func NewValidationError ¶
func (*Exception) AsJsonMessage ¶
func (*Exception) Type ¶
func (e *Exception) Type() ExceptionType
type ExceptionType ¶
type ExceptionType int
const ( ExceptionTypeInternalServerException ExceptionType = iota ExceptionTypeInvalidInputException ExceptionTypeResourceNotFoundException ExceptionTypeInternalFailureException ExceptionTypeSerializationException ExceptionTypeUnknownOperationException ExceptionTypeValidationException )
func (ExceptionType) String ¶
func (e ExceptionType) String() string
Click to show internal directories.
Click to hide internal directories.