Documentation
¶
Index ¶
- Constants
- Variables
- func Is(err, target error) bool
- func IsNotFount(err error) bool
- func LackParameterError(name string) error
- func New(text string) error
- func NewMultipleServerError(status int, prefix string, code ...string) *errors.Errors
- func NewServerError(status int, msg string, code ...string) errors.Error
- func WithMessage(err error, msg string) error
- func WithServerError(status int, err error, msg string, code ...string) errors.Error
- type ServerError
Constants ¶
View Source
const ( CodeSystemError = "E0000" CodeInvalidCredentials = "E0001" CodeUserDisable = "E0002" CodeUserStatusUnknown = "E0003" CodeUserNeedResetPassword = "E0004" CodeUserInactive = "E0005" CodeTooManyLoginFailures = "E0006" CodePasswordBaseGeneralTooSimple = "E0010" CodePasswordBaseSafeTooSimple = "E0011" CodePasswordBaseVerySafeTooSimple = "E0012" CodePasswordCannotContainUsername = "E0013" CodePasswordTooShort = "E0014" CodePasswordRepetition = "E0015" CodePasswordTooSimple = "E0016" CodeRequestTooFrequently = "E0429" CodeAppMemberCannotBeEmpty = "E1101" CodeAppCannotBeDelete = "E1102" )
Variables ¶
View Source
var ( InternalServerError = func() error { return NewServerError(http.StatusInternalServerError, "Internal server error") } NotLoginError = func() error { return NewServerError(http.StatusInternalServerError, "Not logged in") } BadRequestError = func() error { return NewServerError(http.StatusBadRequest, "Invalid Request") } ParameterError = func(msg string) error { return NewServerError(http.StatusBadRequest, "Parameter Error: "+msg) } StatusNotFound = func(name string) errors.Error { return NewServerError(http.StatusNotFound, name+" Not Found") } StatusForbidden = func(name string) errors.Error { return NewServerError(http.StatusForbidden, name+" StatusForbidden") } NotFoundError = func() error { return NewServerError(http.StatusNotFound, "record not found") } )
Functions ¶
func IsNotFount ¶
func LackParameterError ¶
func NewMultipleServerError ¶
func WithMessage ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.