Documentation ¶
Index ¶
- Variables
- type ErrorCode
- type IRestError
- func ErrorResponse(err error) (IRestError, int)
- func NewBadRequestError(err error, code string, text string) IRestError
- func NewConflictError(err error, code string, text string) IRestError
- func NewForbiddenError(err error, code string, text string) IRestError
- func NewInternalServerError(err error, code string, text string) IRestError
- func NewNoContentError(err error, code string, text string) IRestError
- func NewNotFoundError(err error, code string, text string) IRestError
- func NewRestError(status int, err error, code ErrorCode, text string) IRestError
- func NewUnauthorizedError(err error, code string, text string) IRestError
- type RestError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BadRequest = errors.New("Bad request") AlreadyExists = errors.New("Already Existed") WrongCredentials = errors.New("Wrong Credentials") NotFound = errors.New("Not Found") NoContent = errors.New("No Content") Forbidden = errors.New("Forbidden") PermissionDenied = errors.New("Permission Denied") ExpiredCSRFError = errors.New("Expired CSRF token") WrongCSRFToken = errors.New("Wrong CSRF token") CSRFNotPresented = errors.New("CSRF not presented") NotRequiredFields = errors.New("No such required fields") BadQueryParams = errors.New("Invalid query params") InternalServerError = errors.New("Internal Server Error") RequestTimeoutError = errors.New("Request Timeout") ExistsEmailError = errors.New("User with given email already exists") InvalidJWTToken = errors.New("Invalid JWT token") InvalidJWTClaims = errors.New("Invalid JWT claims") NotAllowedImageHeader = errors.New("Not allowed image header") NoCookie = errors.New("not found cookie header") DuplicateResource = errors.New("Duplicate Resource") )
Functions ¶
This section is empty.
Types ¶
type IRestError ¶
func ErrorResponse ¶
func ErrorResponse(err error) (IRestError, int)
func NewBadRequestError ¶
func NewBadRequestError(err error, code string, text string) IRestError
func NewConflictError ¶
func NewConflictError(err error, code string, text string) IRestError
func NewForbiddenError ¶
func NewForbiddenError(err error, code string, text string) IRestError
func NewInternalServerError ¶
func NewInternalServerError(err error, code string, text string) IRestError
func NewNoContentError ¶
func NewNoContentError(err error, code string, text string) IRestError
func NewNotFoundError ¶
func NewNotFoundError(err error, code string, text string) IRestError
func NewRestError ¶
func NewRestError(status int, err error, code ErrorCode, text string) IRestError
func NewUnauthorizedError ¶
func NewUnauthorizedError(err error, code string, text string) IRestError
Click to show internal directories.
Click to hide internal directories.