Documentation ¶
Index ¶
- Constants
- type ApiError
- func NewCouldNotValidate(err error) *ApiError
- func NewEntityCanNotBeDeleted() *ApiError
- func NewEntityCanNotBeDeletedFrom(err error) *ApiError
- func NewEntityCanNotBeUpdatedFrom(err error) *ApiError
- func NewFieldApiError(fieldError *FieldError) *ApiError
- func NewInvalidFilter(cause error) *ApiError
- func NewInvalidPagination(err error) *ApiError
- func NewInvalidSort(err error) *ApiError
- func NewNotFound() *ApiError
- func NewUnauthorized() *ApiError
- func NewUnhandled(cause error) *ApiError
- type ErrorHolder
- type ErrorHolderImpl
- type FieldError
Constants ¶
View Source
const ( NotFoundCode string = "NOT_FOUND" NotFoundMessage string = "The resource requested was not found or is no longer available" NotFoundStatus int = http.StatusNotFound UnhandledCode string = "UNHANDLED" UnhandledMessage string = "An unhandled error occurred" UnhandledStatus int = http.StatusInternalServerError InvalidFieldCode string = "INVALID_FIELD" InvalidFieldMessage string = "The field contains an invalid value" InvalidFieldStatus int = http.StatusBadRequest EntityCanNotBeDeletedCode string = "ENTITY_CAN_NOT_BE_DELETED" EntityCanNotBeDeletedMessage string = "The entity requested for delete can not be deleted" EntityCanNotBeDeletedStatus = http.StatusBadRequest EntityCanNotBeUpdatedCode string = "ENTITY_CAN_NOT_BE_UPDATED" EntityCanNotBeUpdatedMessage string = "The entity requested for update can not be updated" EntityCanNotBeUpdatedStatus = http.StatusBadRequest CouldNotValidateCode string = "COULD_NOT_VALIDATE" CouldNotValidateMessage string = "The supplied request contains an invalid document or no valid accept content were available, see cause" CouldNotValidateStatus int = http.StatusBadRequest )
View Source
const ( InvalidFilterCode string = "INVALID_FILTER" InvalidFilterMessage string = "The filter query supplied is invalid" InvalidFilterStatus int = httpStatusInvalidFilter InvalidPaginationCode string = "INVALID_PAGINATION" InvalidPaginationMessage string = "The pagination properties provided are invalid" InvalidPaginationStatus int = http.StatusBadRequest InvalidSortCode string = "INVALID_SORT_IDENTIFIER" InvalidSortMessage string = "The sort order supplied is invalid" InvalidSortStatus int = http.StatusBadRequest )
specific
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiError ¶ added in v0.15.25
type ApiError struct { Code string `json:"code"` Message string `json:"message"` Status int `json:"-"` Cause error `json:"cause"` AppendCause bool `json:"-"` }
func NewCouldNotValidate ¶ added in v0.15.25
func NewEntityCanNotBeDeleted ¶ added in v0.15.25
func NewEntityCanNotBeDeleted() *ApiError
func NewEntityCanNotBeDeletedFrom ¶ added in v0.15.26
func NewEntityCanNotBeUpdatedFrom ¶ added in v0.15.26
func NewFieldApiError ¶ added in v0.15.25
func NewFieldApiError(fieldError *FieldError) *ApiError
func NewInvalidFilter ¶ added in v0.15.25
func NewInvalidPagination ¶ added in v0.15.25
func NewInvalidSort ¶ added in v0.15.25
func NewNotFound ¶ added in v0.15.25
func NewNotFound() *ApiError
func NewUnauthorized ¶ added in v0.15.25
func NewUnauthorized() *ApiError
func NewUnhandled ¶ added in v0.15.25
type ErrorHolder ¶
type ErrorHolderImpl ¶
type ErrorHolderImpl struct {
Err error
}
func (*ErrorHolderImpl) GetError ¶
func (holder *ErrorHolderImpl) GetError() error
func (*ErrorHolderImpl) HasError ¶
func (holder *ErrorHolderImpl) HasError() bool
func (*ErrorHolderImpl) SetError ¶
func (holder *ErrorHolderImpl) SetError(err error) bool
type FieldError ¶ added in v0.15.25
type FieldError struct { Reason string `json:"message"` FieldName string `json:"field"` FieldValue interface{} `json:"value"` }
func NewFieldError ¶ added in v0.15.25
func NewFieldError(reason, name string, value interface{}) *FieldError
func (FieldError) Error ¶ added in v0.15.25
func (fe FieldError) Error() string
Click to show internal directories.
Click to hide internal directories.