Documentation
¶
Index ¶
- type ErrorType
- type LambdaError
- func NewConflictError(msg string, err error) *LambdaError
- func NewForbiddenError(msg string, err error) *LambdaError
- func NewInternalServerError(msg string, err error) *LambdaError
- func NewInvalidRequestError(msg string, err error) *LambdaError
- func NewMethodNotAllowedError() *LambdaError
- func NewNotFoundError(msg string, err error) *LambdaError
- func NewRequestFailedError(msg string, err error) *LambdaError
- func NewServiceUnavailableError(msg string, err error) *LambdaError
- func NewUnauthorizedError(msg string, err error) *LambdaError
- func NewValidationFailedError(msg string, err error) *LambdaError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorType ¶
type ErrorType string
ErrorType represents the type of error
const ( // ErrorTypeInvalidRequest represents an invalid request error ErrorTypeInvalidRequest ErrorType = "InvalidRequest" ErrorTypeUnauthorized ErrorType = "Unauthorized" // ErrorTypeForbidden represents a forbidden error ErrorTypeForbidden ErrorType = "Forbidden" // ErrorTypeNotFound represents a not found error ErrorTypeNotFound ErrorType = "NotFound" // ErrorTypeMethodNotAllowed represents a method not allowed error ErrorTypeMethodNotAllowed ErrorType = "MethodNotAllowed" // ErrorTypeConflict represents a conflict error ErrorTypeConflict ErrorType = "Conflict" // ErrorTypeInternalServer represents an internal server error ErrorTypeInternalServer ErrorType = "InternalServerError" ErrorTypeServiceUnavailable ErrorType = "ServiceUnavailable" // ErrorTypeValidationFailed represents a validation failed error ErrorTypeValidationFailed ErrorType = "ValidationFailed" // ErrorTypeRequestFailed represents a request failed error (typically for downstream requests) ErrorTypeRequestFailed ErrorType = "RequestFailed" )
type LambdaError ¶
LambdaError represents a custom error for Lambda functions
func NewConflictError ¶
func NewConflictError(msg string, err error) *LambdaError
NewConflictError creates a new conflict error
func NewForbiddenError ¶
func NewForbiddenError(msg string, err error) *LambdaError
NewForbiddenError creates a new forbidden error
func NewInternalServerError ¶
func NewInternalServerError(msg string, err error) *LambdaError
NewInternalServerError creates a new internal server error
func NewInvalidRequestError ¶
func NewInvalidRequestError(msg string, err error) *LambdaError
NewInvalidRequestError creates a new invalid request error
func NewMethodNotAllowedError ¶
func NewMethodNotAllowedError() *LambdaError
NewMethodNotAllowedError creates a new method not allowed error
func NewNotFoundError ¶
func NewNotFoundError(msg string, err error) *LambdaError
NewNotFoundError creates a new not found error
func NewRequestFailedError ¶
func NewRequestFailedError(msg string, err error) *LambdaError
NewRequestFailedError creates a new request failed error
func NewServiceUnavailableError ¶
func NewServiceUnavailableError(msg string, err error) *LambdaError
NewServiceUnavailableError creates a new service unavailable error
func NewUnauthorizedError ¶
func NewUnauthorizedError(msg string, err error) *LambdaError
NewUnauthorizedError creates a new unauthorized error
func NewValidationFailedError ¶
func NewValidationFailedError(msg string, err error) *LambdaError
NewValidationFailedError creates a new validation failed error
func (*LambdaError) Error ¶
func (e *LambdaError) Error() string
Error implements the error interface
func (*LambdaError) ToAPIGatewayResponse ¶
func (e *LambdaError) ToAPIGatewayResponse() events.APIGatewayProxyResponse
ToAPIGatewayResponse converts a LambdaError to an APIGatewayProxyResponse