Versions in this module Expand all Collapse all v0 v0.4.0 Jan 26, 2018 v0.3.4 Mar 4, 2018 v0.3.3 Jan 4, 2018 v0.3.1 Dec 20, 2017 v0.3.0 Dec 1, 2017 v0.2.0 Oct 13, 2017 Changes in this version + const ReasonInternal + const ReasonRequest + var ErrorAlreadyExist = NewFormatError(http.StatusConflict, ReasonRequest, "conflict: %s already exist") + var ErrorAuthenticationRequired = NewFormatError(http.StatusProxyAuthRequired, ReasonRequest, "authentication required") + var ErrorContentNotFound = NewFormatError(http.StatusNotFound, ReasonRequest, "content %s not found") + var ErrorCreateFailed = NewFormatError(http.StatusBadRequest, ReasonInternal, "failed to create %s: %s") + var ErrorDeleteFailed = NewFormatError(http.StatusBadRequest, ReasonInternal, "failed to delete %s: %s") + var ErrorGetFailed = NewFormatError(http.StatusBadRequest, ReasonInternal, "failed to get %s: %s") + var ErrorHeaderParamNotFound = NewFormatError(http.StatusBadRequest, ReasonRequest, "can't find param %s in request header") + var ErrorInternalTypeError = NewFormatError(http.StatusInternalServerError, ReasonInternal, ...) + var ErrorListFailed = NewFormatError(http.StatusBadRequest, ReasonInternal, "failed to list %s: %s") + var ErrorParamNotFound = NewFormatError(http.StatusBadRequest, ReasonRequest, "can't find param %s in request") + var ErrorParamTypeError = NewFormatError(http.StatusBadRequest, ReasonRequest, "param %s should be %s, but got %s") + var ErrorQuotaExceeded = NewFormatError(http.StatusForbidden, ReasonRequest, "%s quota exceeded") + var ErrorUnknownInternal = NewFormatError(http.StatusInternalServerError, ReasonInternal, "unknown error: %s") + var ErrorUnknownNotFoundError = NewFormatError(http.StatusInternalServerError, ReasonInternal, ...) + var ErrorUnknownRequest = NewFormatError(http.StatusBadRequest, ReasonRequest, "%s") + var ErrorUpdateFailed = NewFormatError(http.StatusBadRequest, ReasonInternal, "failed to update %s: %s") + var ErrorUrlParamNotFound = NewFormatError(http.StatusBadRequest, ReasonRequest, ...) + var ErrorValidationFailed = NewFormatError(http.StatusBadRequest, ReasonRequest, "failed to validate %s: %s") + func NewCreateError(name, errorMessage string) error + func NewDeleteError(name, errorMessage string) error + func NewErrorID() int + func NewGetError(name, errorMessage string) error + func NewListError(name, errorMessage string) error + func NewNotFoundError(name string) error + func NewUpdateError(name, errorMessage string) error + func NewValidateError(name, reason string) error + type Error struct + Code int + Detail string + ID int + Message string + Reason string + func NewFormatError(code int, reason string, format string) *Error + func NewStaticError(code int, reason string, message string) *Error + func (e *Error) Equal(err error) bool + func (e *Error) Error() string + func (e *Error) Format(params ...interface{}) *Error + func (r *Error) AppendErrorDetail(b []byte) []byte + func (r *Error) ErrorDetail() string