errors

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 1 Imported by: 1 module, 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
	UnauthorizedCode
	ForbiddenCode
	NotFoundCode
	AlreadyExistCode
	InternalCode
	TemporaryDisabledCode
	TimeoutCode
)

normal code of application.

View Source
const (
	RouteNotFoundCode int = iota + 1100001
	BindErrorCode
	FormFileErrorCode
)

hertz code.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

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

func NewAlreadyExistError

func NewAlreadyExistError(resourceType, content string) *AppError

func NewForbiddenError

func NewForbiddenError() *AppError

func NewHertzBindError

func NewHertzBindError(err error) *AppError

func NewHertzFormFileError

func NewHertzFormFileError(err error) *AppError

func NewInternalError

func NewInternalError(err error) *AppError

func NewInvalidError

func NewInvalidError(params ...string) *AppError

func NewNotFoundError

func NewNotFoundError(resourceType, content string) *AppError

func NewUnauthorizedError

func NewUnauthorizedError(message string) *AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) GetCode

func (e *AppError) GetCode() int

type Error

type Error interface {
	error

	GetCode() int

	Error() string
}

Jump to

Keyboard shortcuts

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