Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrServerExited = fmt.Errorf("server exited")
Functions ¶
func GetGeneralResponseCode ¶
func GetGeneralResponseCode(response ErrorResponse) int
GetGeneralResponseCode returns the most common error code class in response
func HttpCodeForDaoError ¶
HttpCodeForDaoError returns http code for corresponding dao error
Types ¶
type DaoError ¶
type ErrorResponse ¶
type ErrorResponse struct {
Errors []HandlerError `json:"errors"`
}
func NewErrorResponse ¶
func NewErrorResponse(code int, title string, detail string) ErrorResponse
func NewErrorResponseFromEchoError ¶
func NewErrorResponseFromEchoError(echoErr *echo.HTTPError) ErrorResponse
NewErrorResponseFromEchoError creates a new ErrorResponse instance from an echo.HTTPError instance
func NewErrorResponseFromError ¶
func NewErrorResponseFromError(title string, errs ...error) ErrorResponse
NewErrorResponseFromError creates a new ErrorResponse from a list of errors.
func (ErrorResponse) Error ¶
func (er ErrorResponse) Error() string
ErrorResponse makes it compatible with `error` interface.
type HandlerError ¶
type HandlerError struct { Status int `json:"status,omitempty"` // HTTP status code applicable to the error Title string `json:"title,omitempty"` // A summary of the problem Detail string `json:"detail,omitempty"` // An explanation specific to the problem }
func (HandlerError) Error ¶
func (er HandlerError) Error() string
Error makes it compatible with `error` interface.
Click to show internal directories.
Click to hide internal directories.