Documentation
¶
Index ¶
- Variables
- func GetErr(key string) (err error)
- func IsCaptchaErrCode(code stdCode.Code) bool
- func IsCaptchaError(err error) bool
- func IsErr(err error, key string) bool
- func IsError(err interface{}) bool
- func IsFailureCode(code stdCode.Code) bool
- func IsMessage(err interface{}) bool
- func IsOk(err interface{}) bool
- func IsUserDisabled(err error) bool
- func IsUserNoPerm(err error) bool
- func IsUserNotFound(err error) bool
- func IsUserNotLoggedIn(err error) bool
- func JSONBytesParseError(err error, jsonBytes []byte) error
- func OkString(err interface{}) string
- func RegisterErr(key string, err error)
- type ErrorTab
- type Errors
- type Messager
- type NopMessage
- type Stringify
- type Success
- type Successor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrUserNotLoggedIn 用户未登录 ErrUserNotLoggedIn = echo.NewError(echo.T(`User not logged in`), code.Unauthenticated) //ErrUserNotFound 用户不存在 ErrUserNotFound = echo.NewError(echo.T(`User does not exist`), code.UserNotFound) //ErrUserNoPerm 用户无权限 ErrUserNoPerm = echo.NewError(echo.T(`User has no permission`), code.NonPrivileged) //ErrUserDisabled 用户已被禁用 ErrUserDisabled = echo.NewError(echo.T(`User has been disabled`), code.UserDisabled) //ErrBalanceNoEnough 余额不足 ErrBalanceNoEnough = echo.NewError(echo.T(`Balance is not enough`), code.BalanceNoEnough) //ErrInvalidAppID App ID 无效 ErrInvalidAppID = echo.NewError(echo.T(`Invalid app id`), code.InvalidAppID) //ErrInvalidSign 无效签名 ErrInvalidSign = echo.NewError(echo.T(`Invalid sign`), code.InvalidSignature) //ErrInvalidToken 令牌无效 ErrInvalidToken = echo.NewError(echo.T(`Invalid token`), code.InvalidToken) //ErrCaptcha 验证码错误 ErrCaptcha = captcha.ErrCaptcha //ErrCaptchaIdMissing 缺少captchaId ErrCaptchaIdMissing = captcha.ErrCaptchaIdMissing //ErrCaptchaCodeRequired 验证码不能为空 ErrCaptchaCodeRequired = captcha.ErrCaptchaCodeRequired //ErrRepeatOperation 重复操作 ErrRepeatOperation = echo.NewError(echo.T(`Repeat operation`), code.RepeatOperation) //ErrUnsupported 不支持 ErrUnsupported = echo.NewError(echo.T(`Unsupported`), code.Unsupported) //ErrOperationTimeout 操作超时 ErrOperationTimeout = echo.NewError(echo.T(`Operation timeout`), code.OperationTimeout) //ErrOperationFail 操作失败 ErrOperationFail = echo.NewError(echo.T(`Operation fail`), code.Failure) //ErrResponseFormatError 响应格式错误 ErrResponseFormatError = echo.NewError(echo.T(`Response format error`), code.AbnormalResponse) //ErrRequestTimeout 提交超时 ErrRequestTimeout = echo.NewError(echo.T(`Request timeout`), code.RequestTimeout) //ErrRequestFail 提交失败 ErrRequestFail = echo.NewError(echo.T(`Request fail`), code.RequestFailure) // ErrIgnoreConfigChange 忽略配置文件更改 ErrIgnoreConfigChange = errors.New(`Ignore configuration file changes`) // ErrNext 需要继续向下检查 ErrNext = errors.New("Next") ErrConcurrentLock = errors.New("Concurrent lock has been triggered") ErrContextCanceled = errors.New("Context canceled") )
View Source
var NewErrors = errorslice.New
Functions ¶
func IsFailureCode ¶
func JSONBytesParseError ¶
func RegisterErr ¶
Types ¶
type Errors ¶
type Errors = errorslice.Errors
type Messager ¶
Messager 信息接口
var DefaultNopMessage Messager = &NopMessage{}
DefaultNopMessage 默认空消息
Click to show internal directories.
Click to hide internal directories.