Documentation ¶
Index ¶
- type Amount
- type AppError
- func NewAuthorizationError(err error, message string) *AppError
- func NewBadRequestError(err error, message string) *AppError
- func NewDBError(err error, message string) *AppError
- func NewForbiddenError(err error, message string) *AppError
- func NewInternalServerError(err error, message string) *AppError
- func NewNotFoundError(err error, message string) *AppError
- type Error
- type UUID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct { Code int `json:"code" example:"400"` Message string `json:"message" example:"Error message"` Cause error `json:"-"` Location string `json:"-"` }
AppError Implements Error
func NewAuthorizationError ¶
NewAuthorizationError Create a 401 Unauthorized.
err error The error to wrap. message string The generic message to show.
func NewBadRequestError ¶
NewBadRequestError Create a 400 Bad Request Error.
err error The error to wrap. message string The generic message to show.
func NewDBError ¶
NewDBError Create a 500 Internal Server Error due to a DB failure.
err error The error to wrap. message string The generic message to show.
func NewForbiddenError ¶
NewForbiddenError Create a 403 Forbidden Error.
err error The error to wrap. message string The generic message to show.
func NewInternalServerError ¶
NewInternalServerError Create a 500 Internal Server Error.
err error The error to wrap. message string The generic message to show.
func NewNotFoundError ¶
NewNotFoundError Create a 404 Not Found Error.
err error The error to wrap. message string The generic message to show.
func (*AppError) GetLocation ¶
GetLocation Returns the error location.
func (*AppError) GetMessage ¶
GetMessage Returns the error message.
Click to show internal directories.
Click to hide internal directories.