Documentation ¶
Index ¶
Constants ¶
View Source
const ( // General error codes. ServerInternalError = 500 // Server internal error ArgsError = 1001 // Input parameter error NoPermissionError = 1002 // Insufficient permission DuplicateKeyError = 1003 RecordNotFoundError = 1004 // Record does not exist TokenExpiredError = 1501 TokenMalformedError = 1503 TokenNotValidYetError = 1504 TokenUnknownError = 1505 )
Variables ¶
View Source
var ( ErrArgs = NewCodeError(ArgsError, "ArgsError") ErrNoPermission = NewCodeError(NoPermissionError, "NoPermissionError") ErrInternalServer = NewCodeError(ServerInternalError, "ServerInternalError") ErrRecordNotFound = NewCodeError(RecordNotFoundError, "RecordNotFoundError") ErrDuplicateKey = NewCodeError(DuplicateKeyError, "DuplicateKeyError") ErrTokenMalformed = NewCodeError(TokenMalformedError, "TokenMalformedError") // ErrTokenNotValidYet = NewCodeError(TokenNotValidYetError, "TokenNotValidYetError") // ErrTokenUnknown = NewCodeError(TokenUnknownError, "TokenUnknownError") ErrTokenExpired = NewCodeError(TokenExpiredError, "TokenExpiredError") )
View Source
var DefaultCodeRelation = newCodeRelation()
Functions ¶
Types ¶
type CodeError ¶
type CodeError interface { Code() int Msg() string Detail() string WithDetail(detail string) CodeError Error }
func NewCodeError ¶
type CodeRelation ¶ added in v0.0.47
Click to show internal directories.
Click to hide internal directories.