github.com/binbinly/pkg@v0.0.11-0.20240321014439-f4fbf666eb0f/errno/code.go (about) 1 package errno 2 3 // nolint: golint 4 // common error 预定义错误 5 var ( 6 Success = NewError(0, "Ok") 7 ErrInternalServer = NewError(10000, "Internal server error") 8 ErrInvalidParam = NewError(10001, "Invalid params") 9 ErrUnauthorized = NewError(10002, "Unauthorized error") 10 ErrNotFound = NewError(10003, "Not found") 11 ErrUnknown = NewError(10004, "Unknown") 12 ErrDeadlineExceeded = NewError(10005, "Deadline exceeded") 13 ErrAccessDenied = NewError(10006, "Access denied") 14 ErrLimitExceed = NewError(10007, "Beyond limit") 15 ErrMethodNotAllowed = NewError(10008, "Method not allowed") 16 ErrSignParam = NewError(10011, "Invalid sign") 17 ErrValidation = NewError(10012, "Validation failed") 18 ErrDatabase = NewError(10013, "Database error") 19 ErrToken = NewError(10014, "Gen token error") 20 ErrInvalidToken = NewError(10015, "Invalid token") 21 ErrTokenTimeout = NewError(10016, "Token timeout") 22 ErrTooManyRequests = NewError(10017, "Too many request") 23 ErrInvalidTransaction = NewError(10018, "Invalid transaction") 24 ErrEncrypt = NewError(10019, "Encrypting the user password error") 25 ErrServiceUnavailable = NewError(10020, "Service Unavailable") 26 )