Documentation ¶
Index ¶
- Constants
- func ErrorHandler(err error) (int, interface{})
- func NewBadRequestError(msg ...string) error
- func NewBadRequestWithData(code int, data interface{}) error
- func NewDefaultError() error
- func NewForbiddenError(msg ...string) error
- func NewInternetError(msg ...string) error
- func NewLogicError(code int) error
- func NewNotFoundError(msg ...string) error
- func NewTooManyRequestError(msg ...string) error
- func NewUnauthorizedError(msg ...string) error
- type CodeError
- type CodeErrorResponse
Constants ¶
View Source
const ( ErrorDefaultBadRequest = 400 ErrorDefaultUnanthorized = 401 ErrorDefaultForbidden = 403 ErrorDefaultNotFound = 404 ErrorDefaultMethodNotAllowed = 405 ErrorInternet = 500 ErrorDefault = 1001 ErrorAccountOrPassword = 1002 ErrorNotFound = 1004 ErrorImportStaffData = 1005 ErrorDataExists = 1006 )
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func NewBadRequestError ¶
func NewBadRequestWithData ¶
func NewDefaultError ¶
func NewDefaultError() error
func NewForbiddenError ¶
func NewInternetError ¶
func NewLogicError ¶
func NewNotFoundError ¶
func NewTooManyRequestError ¶
func NewUnauthorizedError ¶
Types ¶
type CodeError ¶
type CodeError struct { HttpCode int Code int `json:"code"` Message string `json:"message"` Content interface{} `json:"data,omitempty"` }
func (*CodeError) Data ¶
func (e *CodeError) Data() *CodeErrorResponse
type CodeErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.