Documentation ¶
Index ¶
- Variables
- func NewBadRequestError(msg ...string) error
- func NewForbiddenError(msg ...string) error
- func NewInternalServerError(msg ...string) error
- func NewMessageError(parent error, msg ...string) error
- func NewNotFoundError(msg ...string) error
- func NewUnauthorizedError(msg ...string) error
- type MessageError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERROR_EMPTY_TOKEN = errors.New("Token为空!") ERROR_UID_NOT_EXISTS = errors.New("userId not exist!") ERROR_INVALID_TOKEN = errors.New("无效的Token!") ERROR_USER_INFO = errors.New("请完善用户信息") New = errors.New Wrap = errors.Wrap Wrapf = errors.Wrapf ErrForbidden = New("禁止访问") ErrNotFound = New("资源不存在") ErrBadRequest = New("请求无效") ErrInternalServer = New("服务器错误") )
ErrBadRequest_STATUS = 400 ErrUnauthorized_STATUS = 401 ErrForbidden_STATUS = 403 ErrNotFound_STATUS = 404 ErrInternalServer_STATUS = 500 定义通用错误
Functions ¶
func NewInternalServerError ¶
NewInternalServerError 创建服务器错误
func NewMessageError ¶
NewMessageError 创建自定义消息错误
func NewUnauthorizedError ¶
NewUnauthorizedError 创建未授权错误
Types ¶
type MessageError ¶
type MessageError struct {
// contains filtered or unexported fields
}
MessageError 自定义消息错误
func (*MessageError) Error ¶
func (m *MessageError) Error() string
Click to show internal directories.
Click to hide internal directories.