errs

package
v0.0.0-...-6f70ee3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotExists error = &Error{
	HTTPStatus: http.StatusNotFound,
	Msg:        "文件不存在",
}

ErrFileNotExists 文件不存在

View Source
var ErrIllegalRequest error = &Error{
	HTTPStatus: http.StatusExpectationFailed,
	Msg:        "非法请求",
}

ErrIllegalRequest 非法请求

View Source
var ErrNeedLogin error = &Error{
	HTTPStatus: http.StatusUnauthorized,
	Msg:        "请先登陆",
}

ErrNeedLogin 登录时未知用户

View Source
var ErrNoAuth error = &Error{
	HTTPStatus: http.StatusForbidden,
	Msg:        "未授权访问",
}

ErrNoAuth 无授权或授权非法

View Source
var ErrTooManyRequest error = &Error{
	HTTPStatus: http.StatusTooManyRequests,
	Msg:        "请求过载",
}

ErrTooManyRequest 请求频繁

Functions

func Msg

func Msg(err error) string

Msg 获取错误描述

func NewParamsErr

func NewParamsErr(err error) error

NewParamsErr 新建参数错误

func NewParamsErrMsg

func NewParamsErrMsg(msg string) error

NewParamsErrMsg 新建参数错误

func NewSystemBusyErr

func NewSystemBusyErr(err error) error

NewSystemBusyErr 新建系统错误

func Unwrap

func Unwrap(err error) error

Unwrap 获取底层错误

Types

type Error

type Error struct {
	HTTPStatus int
	Msg        string
	WrappedErr error
}

Error 错误

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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