Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrUnknown - 500: Internal server error. ErrUnknown int = iota + 100001 // ErrGenerateToken - 500: Error occurred while generating token. ErrGenerateToken // ErrParseToken - 500: Error occurred while parsing from token. ErrParseToken // ErrBindAndValidation - 400: Error occurred while binding the request body to the struct or validation failed. ErrBindAndValidation // ErrDatabase - 500: Database error. ErrDatabase // ErrRedis - 500: Redis error. ErrRedis // ErrPasswordInvalid - 400: Password invalid. ErrPasswordInvalid // ErrPasswordIncorrect - 401: Password incorrect. ErrPasswordIncorrect // ErrPasswordHash - 500: Error occurred while hashing password. ErrPasswordHash // ErrClientRPCInit - 500: RPC client initialization error. ErrClientRPCInit // ErrRPCLink - 500: RPC service link error. ErrRPCLink // ErrEncodingFailed - 500: Encoding failed. ErrEncodingFailed // ErrMinio - 500: Minio error. ErrMinio // ErrOpenFormFile - 500: Open request's form file error. ErrOpenFormFile // ErrInvalidUser - 400: User does not exist. ErrInvalidUser // ErrInvalidVideo - 400: Video does not exist. ErrInvalidVideo )
通用:基本错误 Code must start with 1xxxxx
View Source
const ( ErrStatusNotFound int = iota + 100101 ErrStatusMethodNotAllowed ErrStatusInternalServerError )
View Source
const ErrSuccess int32 = 0
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrCode ¶
type ErrCode struct { // C refers to the code of the ErrCode. C int // HTTP status that should be used for the associated error code. HTTP int // External (user) facing error text. Ext string // Ref specify the reference document. Ref string }
ErrCode implements `github.com/marmotedu/errors`.Coder interface.
func (ErrCode) HTTPStatus ¶
HTTPStatus returns the associated HTTP status code, if any. Otherwise, returns 200.
Click to show internal directories.
Click to hide internal directories.