errors

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func IsCode

func IsCode(err error, code int) bool

IsCode ...

Types

type AppError

type AppError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Inner   error  `json:"-"`
}

AppError ...

func NewCannotExecError

func NewCannotExecError(msg string) *AppError

NewCannotExecError ...

func NewHertzBindError

func NewHertzBindError(err error) *AppError

NewHertzBindError ...

func NewHertzRouteNotFoundError

func NewHertzRouteNotFoundError(ctx *app.RequestContext) *AppError

NewHertzRouteNotFoundError ...

func NewInternalError

func NewInternalError(err error) *AppError

NewInternalError ...

func NewInvalidError

func NewInvalidError(params ...string) *AppError

NewInvalidError ...

func NewNotFoundError

func NewNotFoundError(resourceType, content string) *AppError

NewNotFoundError ...

func (*AppError) Error

func (e *AppError) Error() string

Error ...

func (*AppError) GetCode

func (e *AppError) GetCode() int

GetCode ...

type Error

type Error interface {
	error
	GetCode() int
	Error() string
}

Error is wrapped error with code and inner error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL