Documentation ¶
Index ¶
- Variables
- func IsAPIError(err error) bool
- func IsConflict(err error) bool
- func NewAPIError(code ErrorCode, message string) error
- func NewAPIErrorLong(status int, code, message string) error
- func NewFieldAPIError(code ErrorCode, fieldName, message string) error
- func WrapAPIError(err error, code ErrorCode, message string) error
- func WrapFieldAPIError(err error, code ErrorCode, fieldName, message string) error
- type APIError
- type ErrorCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PermissionDenied = ErrorCode{"PermissionDenied", 403} NotFound = ErrorCode{"NotFound", 404} MethodNotAllowed = ErrorCode{"MethodNotAllowed", 405} Conflict = ErrorCode{"Conflict", 409} InvalidDateFormat = ErrorCode{"InvalidDateFormat", 422} InvalidFormat = ErrorCode{"InvalidFormat", 422} InvalidReference = ErrorCode{"InvalidReference", 422} NotNullable = ErrorCode{"NotNullable", 422} NotUnique = ErrorCode{"NotUnique", 422} MinLimitExceeded = ErrorCode{"MinLimitExceeded", 422} MaxLimitExceeded = ErrorCode{"MaxLimitExceeded", 422} MinLengthExceeded = ErrorCode{"MinLengthExceeded", 422} MaxLengthExceeded = ErrorCode{"MaxLengthExceeded", 422} InvalidOption = ErrorCode{"InvalidOption", 422} InvalidCharacters = ErrorCode{"InvalidCharacters", 422} MissingRequired = ErrorCode{"MissingRequired", 422} InvalidCSRFToken = ErrorCode{"InvalidCSRFToken", 422} InvalidAction = ErrorCode{"InvalidAction", 422} InvalidBodyContent = ErrorCode{"InvalidBodyContent", 422} InvalidType = ErrorCode{"InvalidType", 422} ActionNotAvailable = ErrorCode{"ActionNotAvailable", 404} InvalidState = ErrorCode{"InvalidState", 422} ServerError = ErrorCode{"ServerError", 500} ErrComplete = errors.New("request completed") )
Functions ¶
func IsAPIError ¶
func IsConflict ¶
func NewAPIError ¶
func NewAPIErrorLong ¶
func NewFieldAPIError ¶
func WrapAPIError ¶
WrapAPIError will cause the API framework to log the underlying err before returning the APIError as a response. err WILL NOT be in the API response
Types ¶
Click to show internal directories.
Click to hide internal directories.