Documentation ¶
Overview ¶
Package v1 represents types used by the web application for v1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRequestError ¶
IsRequestError checks if an error of type RequestError exists.
func NewRequestError ¶
NewRequestError wraps a provided error with an HTTP status code. This function should be used when handlers encounter expected errors.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` Fields map[string]string `json:"fields,omitempty"` }
ErrorResponse is the form used for API responses from failures in the API.
type RequestError ¶
RequestError is used to pass an error during the request through the application with web specific context.
func GetRequestError ¶
func GetRequestError(err error) *RequestError
GetRequestError returns a copy of the RequestError pointer.
func (*RequestError) Error ¶
func (re *RequestError) Error() string
Error implements the error interface. It uses the default message of the wrapped error. This is what will be shown in the services' logs.
Click to show internal directories.
Click to hide internal directories.