Documentation ¶
Index ¶
- Variables
- func ErrBadRequest(message ...string) *errors.Error
- func ErrBadRequestf(format string, a ...any) *errors.Error
- func ErrBadRequestw(opt ...Option) *errors.Error
- func ErrBizError(message ...string) *errors.Error
- func ErrBizErrorf(format string, a ...any) *errors.Error
- func ErrBizErrorw(opt ...Option) *errors.Error
- func ErrCustom(message ...string) *errors.Error
- func ErrCustomf(format string, a ...any) *errors.Error
- func ErrCustomw(opt ...Option) *errors.Error
- func ErrInternalServer(message ...string) *errors.Error
- func ErrInternalServerf(format string, a ...any) *errors.Error
- func ErrInternalServerw(opt ...Option) *errors.Error
- func ErrTimeout(message ...string) *errors.Error
- func ErrTimeoutf(format string, a ...any) *errors.Error
- func ErrTimeoutw(opt ...Option) *errors.Error
- func ErrUserOrPasswordIncorrect(message ...string) *errors.Error
- func ErrUserOrPasswordIncorrectf(format string, a ...any) *errors.Error
- func ErrUserOrPasswordIncorrectw(opt ...Option) *errors.Error
- func IsBadRequest(err error) bool
- func IsBizError(err error) bool
- func IsCustom(err error) bool
- func IsInternalServer(err error) bool
- func IsTimeout(err error) bool
- func IsUserOrPasswordIncorrect(err error) bool
- type ErrorReason
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorReason_name = map[int32]string{
0: "INTERNAL_SERVER",
1: "BAD_REQUEST",
2: "TIMEOUT",
3: "CUSTOM",
4: "BIZ_ERROR",
5: "USER_OR_PASSWORD_INCORRECT",
}
View Source
var ErrorReason_value = map[string]int32{
"INTERNAL_SERVER": 0,
"BAD_REQUEST": 1,
"TIMEOUT": 2,
"CUSTOM": 3,
"BIZ_ERROR": 4,
"USER_OR_PASSWORD_INCORRECT": 5,
}
Functions ¶
func ErrBadRequest ¶
func ErrBadRequestw ¶ added in v0.0.2
func ErrBizError ¶
func ErrBizErrorw ¶ added in v0.0.2
func ErrCustomw ¶ added in v0.0.2
func ErrInternalServer ¶
func ErrInternalServerf ¶ added in v0.0.2
func ErrInternalServerw ¶ added in v0.0.2
func ErrTimeout ¶
func ErrTimeoutw ¶ added in v0.0.2
func ErrUserOrPasswordIncorrectf ¶ added in v0.0.2
func ErrUserOrPasswordIncorrectw ¶ added in v0.0.2
func IsBadRequest ¶ added in v0.0.2
func IsBizError ¶ added in v0.0.2
func IsInternalServer ¶ added in v0.0.2
func IsUserOrPasswordIncorrect ¶ added in v0.0.2
Types ¶
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_INTERNAL_SERVER ErrorReason = 0 ErrorReason_BAD_REQUEST ErrorReason = 1 ErrorReason_TIMEOUT ErrorReason = 2 ErrorReason_CUSTOM ErrorReason = 3 ErrorReason_BIZ_ERROR ErrorReason = 4 ErrorReason_USER_OR_PASSWORD_INCORRECT ErrorReason = 5 )
func (ErrorReason) EnumDescriptor ¶
func (ErrorReason) EnumDescriptor() ([]byte, []int)
func (ErrorReason) String ¶
func (x ErrorReason) String() string
type Option ¶ added in v0.0.2
type Option interface {
// contains filtered or unexported methods
}
func WithDetail ¶ added in v0.0.2
func WithMessage ¶ added in v0.0.2
func WithMetadata ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.