Documentation ¶
Index ¶
- Constants
- func LogAndSendServerError(c *gin.Context, err error)
- func SendBadRequest(c *gin.Context, message string)
- func SendBadRequestFromError(c *gin.Context, err error)
- func SendUnprocessableEntity(c *gin.Context, message string)
- func SendUnprocessableEntityFromError(c *gin.Context, err error)
- func WrapLogAndSendServerError(c *gin.Context, err error, message string)
- type ServerError
Constants ¶
View Source
const (
JsonParseError = "Parsing JSON"
)
Variables ¶
This section is empty.
Functions ¶
func LogAndSendServerError ¶
func SendBadRequest ¶ added in v0.8.1
func SendBadRequestFromError ¶ added in v0.8.1
func SendUnprocessableEntity ¶ added in v0.8.1
func SendUnprocessableEntityFromError ¶ added in v0.8.1
Types ¶
type ServerError ¶
type ServerError struct { Errors struct { Fields map[string][]string `json:"fields"` Server []string `json:"server"` } `json:"errors"` }
func SingleFieldError ¶
func SingleFieldError(field string, fieldError string) *ServerError
func SingleServerError ¶
func SingleServerError(serverErrorDescription string) *ServerError
func (*ServerError) AddFieldError ¶
func (se *ServerError) AddFieldError(field string, fieldError string)
func (*ServerError) AddServerError ¶
func (se *ServerError) AddServerError(serverErrorDescription string)
Click to show internal directories.
Click to hide internal directories.