Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorResponse ¶ added in v0.1.5
type ErrorResponse struct {
Message string `json:"message"`
Errors map[string][]string `json:"errors"`
Err error `json:"-"`
}
ErrorResponse holds the errore response message
func NewErrorResponse ¶ added in v0.1.5
func NewErrorResponse(message string, err error) ErrorResponse
NewErrorResponse holds a formatted error response Errors returned from the parser, origin, filter packages Will return in a `key: err` format. Where the key signals the package scope source of the error
func (*ErrorResponse) HandleError ¶ added in v0.1.5
func (e *ErrorResponse) HandleError(ctx context.Context, w http.ResponseWriter, code int)
HandleError will both log and handle the http error for a given error response
Click to show internal directories.
Click to hide internal directories.