Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Success = NewError(0, "成功") ServerError = NewError(10000, "服务内部错误") InvalidParams = NewError(10001, "入参错误") NotFound = NewError(10002, "找不到") )
Functions ¶
func HttpStatusCode ¶
func HttpStatusCode(e mir.Error) int
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) StatusCode ¶
func (*Error) WithDetails ¶
type ValidError ¶
type ValidError struct {
Message string
}
func (*ValidError) Error ¶
func (v *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func (ValidErrors) Error ¶
func (v ValidErrors) Error() string
func (ValidErrors) Errors ¶
func (v ValidErrors) Errors() []string
Click to show internal directories.
Click to hide internal directories.