Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code Message string `json:"error,omitempty"` // application-level error message, for debugging }
ErrResponse is base struct for JSON API error response
func BadRequest ¶
func BadRequest(err error, msg string) *ErrResponse
BadRequest returns ErrResponse for bad request http error
func InvalidParameter ¶
func InvalidParameter(err error, msg string) *ErrResponse
InvalidParameter returns ErrResponse for invalid parameter error
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
Render implements chi.Render interface for ErrResponse
Click to show internal directories.
Click to hide internal directories.