Documentation
¶
Index ¶
- Constants
- func IsCode(err error, code int) bool
- type AppError
- func NewCannotExecError(msg string) *AppError
- func NewHertzBindError(err error) *AppError
- func NewHertzRouteNotFoundError(ctx *app.RequestContext) *AppError
- func NewInternalError(err error) *AppError
- func NewInvalidError(params ...string) *AppError
- func NewNotFoundError(resourceType, content string) *AppError
- type Error
Constants ¶
View Source
const ( InvalidCode int = iota + 1000001 NotFoundCode CannotExecCode InternalCode )
normal code of application.
View Source
const ( RouteNotFoundCode int = iota + 1100001 BindErrorCode )
hertz code.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppError ¶
type AppError struct {
Code int `json:"code"`
Message string `json:"message"`
Inner error `json:"-"`
}
AppError ...
func NewHertzRouteNotFoundError ¶
func NewHertzRouteNotFoundError(ctx *app.RequestContext) *AppError
NewHertzRouteNotFoundError ...
func NewNotFoundError ¶
NewNotFoundError ...
Click to show internal directories.
Click to hide internal directories.