Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidMonth ¶
func InvalidQueryString ¶
func InvalidUUID ¶
Types ¶
type ErrorStatus ¶ added in v2.10.0
type ErrorStatus struct { Err error Status int // Used with http.StatusX for the corresponding HTTP status code }
ErrorStatus is used to return an error with the corresponding HTTP status code to a controller.
func DBError ¶ added in v2.10.0
func DBError(c *gin.Context, err error) ErrorStatus
DBError returns an error message and status code appropriate to the error that has occurred.
func GenericDBError ¶ added in v2.10.0
GenericDBError wraps DBError with a more specific error message for not found errors.
func (ErrorStatus) Body ¶ added in v2.10.0
func (e ErrorStatus) Body() map[string]string
Body returns the the content of the HTTP response body for the error.
func (ErrorStatus) Error ¶ added in v2.10.0
func (e ErrorStatus) Error() string
Error returns the error as string.
func (ErrorStatus) Nil ¶ added in v2.10.0
func (e ErrorStatus) Nil() bool
Nil checks if the ErrorStatus is the zero value.
Click to show internal directories.
Click to hide internal directories.