Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidation ¶
IsValidation returns true if the error is a validation error.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, err error)
WriteResponse writes the instance of error to the response. This results in all errors being returned in a standard structure.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a custom implementation of error, providing an error type and HTTP status code.
func NewValidation ¶
NewValidation returns a new instance of Error, with the typ "Validation".
func (*Error) MarshalJSON ¶
MarshalJSON is a custom JSON marshal func used when writing the error to a http.ResponseWriter.
func (*Error) SetParamName ¶
SetParamName sets the error's paramName property.
func (*Error) SetStatus ¶
SetStatus sets the status code of the error - this is used for the HTTP response.
Click to show internal directories.
Click to hide internal directories.