Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ParameterIsInvalidCode = 1000 + iota // UserNotFoundCode // UserAlreadyBlockCode // UserAlreadyExistsCode // UserRegisterFailedCode // PasswordIncorrectCode // RecordNotExitsCode // RecordQueryFaildCode // RecordCreateFaildCode // RecordDeleteFailedCode // RecordUpdateFailedCode // AccountAuthorizeFailedCode // ServerErrorCode // RouterNotFoundCodeCode // RouterAuthorityLimitCode )
自定义状态码
Variables ¶
View Source
var ErrAccountAuthorizeFailed = NewException("Errors.AccountAuthorizeFailed", http.StatusNonAuthoritativeInfo, AccountAuthorizeFailedCode)
View Source
var ErrAccountPermissionLimit = NewException("Errors.AccountPermissionLimit", http.StatusNonAuthoritativeInfo, AccountAuthorizeFailedCode)
View Source
var ErrInternalServer = NewException("Errors.ServerError", http.StatusInternalServerError, ServerErrorCode)
View Source
var ErrParameterIsInvalid = NewException("Errors.ParameterIsInvalid", http.StatusBadRequest, ParameterIsInvalidCode)
View Source
var ErrPasswordIncorrect = NewException("Errors.PasswordIncorrect", http.StatusBadRequest, PasswordIncorrectCode)
View Source
var ErrRecordCreateFaild = NewException("Errors.RecordCreateFaild", http.StatusBadRequest, RecordCreateFaildCode)
View Source
var ErrRecordDeleteFailed = NewException("Errors.RecordDeleteFaild", http.StatusBadRequest, RecordDeleteFailedCode)
View Source
var ErrRecordNotExits = NewException("Errors.RecordNotExits", http.StatusNotFound, RecordNotExitsCode)
View Source
var ErrRecordQueryFaild = NewException("Errors.RecordQueryFaild", http.StatusBadRequest, RecordQueryFaildCode)
View Source
var ErrRecordUpdateFailed = NewException("Errors.RecordUpdateFaild", http.StatusBadRequest, RecordUpdateFailedCode)
View Source
var ErrRouterForbidden = NewException("Errors.RouterForbidden", http.StatusForbidden, RouterAuthorityLimitCode)
View Source
var ErrRouterNotFound = NewException("Errors.RouterNotFound", http.StatusNotFound, RouterNotFoundCodeCode)
View Source
var ErrUserAlreadyBlock = NewException("Errors.UserAlreadyBlock", http.StatusBadRequest, UserAlreadyBlockCode)
View Source
var ErrUserAlreadyExists = NewException("Errors.UserAlreadyExists", http.StatusBadRequest, UserAlreadyExistsCode)
View Source
var ErrUserNotFound = NewException("Errors.UserNotFound", http.StatusNotFound, UserNotFoundCode)
View Source
var ErrUserRegisterFailed = NewException("Errors.UserRegisterFailed", http.StatusBadRequest, UserRegisterFailedCode)
Functions ¶
func FailWithResponse ¶
func OkWithResponse ¶
Types ¶
type Exception ¶
type Exception struct {
// contains filtered or unexported fields
}
func (*Exception) ErrorMessage ¶
func (*Exception) SetErrorMessage ¶
func (*Exception) SetMessage ¶
Click to show internal directories.
Click to hide internal directories.