weberrors

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERROR_EMPTY_TOKEN    = errors.New("Token为空!")
	ERROR_UID_NOT_EXISTS = errors.New("userId not exist!")
	ERROR_INVALID_TOKEN  = errors.New("无效的Token!")
	ERROR_USER_INFO      = errors.New("请完善用户信息")
	New                  = errors.New
	Wrap                 = errors.Wrap
	Wrapf                = errors.Wrapf
	ErrForbidden         = New("禁止访问")
	ErrNotFound          = New("资源不存在")
	ErrBadRequest        = New("请求无效")
	ErrUnauthorized      = New("未授权")
	ErrInternalServer    = New("服务器错误")
)

ErrBadRequest_STATUS = 400 ErrUnauthorized_STATUS = 401 ErrForbidden_STATUS = 403 ErrNotFound_STATUS = 404 ErrInternalServer_STATUS = 500 定义通用错误

Functions

func NewBadRequestError

func NewBadRequestError(msg ...string) error

NewBadRequestError 创建请求无效错误

func NewForbiddenError

func NewForbiddenError(msg ...string) error

NewForbiddenError 创建资源禁止访问错误

func NewInternalServerError

func NewInternalServerError(msg ...string) error

NewInternalServerError 创建服务器错误

func NewMessageError

func NewMessageError(parent error, msg ...string) error

NewMessageError 创建自定义消息错误

func NewNotFoundError

func NewNotFoundError(msg ...string) error

NewNotFoundError 创建资源不存在错误

func NewUnauthorizedError

func NewUnauthorizedError(msg ...string) error

NewUnauthorizedError 创建未授权错误

Types

type MessageError

type MessageError struct {
	// contains filtered or unexported fields
}

MessageError 自定义消息错误

func (*MessageError) Error

func (m *MessageError) Error() string

func (*MessageError) Parent

func (m *MessageError) Parent() error

Parent 父级错误

Jump to

Keyboard shortcuts

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