errs

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BizCodeInvalidParams = 1001

	BizCodeResourceNotFound                 = 8001
	BizCodeResourceInvalidOS                = 8002
	BizCodeResourceInvalidArch              = 8003
	BizCodeResourceInvalidChannel           = 8004
	BizCodeResourceIDAlreadyExists          = 8005
	BizCodeResourceVersionNameConflict      = 8006
	BizCodeResourceVersionStorageProcessing = 8007
	BizResourceVersionNameUnparsable        = 8008
)

Variables

View Source
var (
	ErrInvalidParams = New(BizCodeInvalidParams, http.StatusBadRequest, "invalid params", nil)

	ErrResourceNotFound                 = New(BizCodeResourceNotFound, http.StatusNotFound, "resource not found", nil)
	ErrResourceInvalidOS                = New(BizCodeResourceInvalidOS, http.StatusBadRequest, "invalid os", nil)
	ErrResourceInvalidArch              = New(BizCodeResourceInvalidArch, http.StatusBadRequest, "invalid arch", nil)
	ErrResourceInvalidChannel           = New(BizCodeResourceInvalidChannel, http.StatusBadRequest, "invalid channel", nil)
	ErrResourceIDAlreadyExists          = New(BizCodeResourceIDAlreadyExists, http.StatusBadRequest, "resource id already exists", nil)
	ErrResourceVersionNameConflict      = New(BizCodeResourceVersionNameConflict, http.StatusConflict, "version name under the current platform architecture already exists", nil)
	ErrResourceVersionStorageProcessing = New(BizCodeResourceVersionStorageProcessing, http.StatusConflict, "current version storage in process", nil)
	ErrResourceVersionNameUnparsable    = New(BizResourceVersionNameUnparsable, http.StatusBadRequest, "version name is not supported for parsing, please use the stable channel", nil)
)

Functions

This section is empty.

Types

type Error

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

func New added in v0.6.0

func New(bizCode, httpCode int, message string, internal error) *Error

func NewUnchecked added in v0.12.0

func NewUnchecked(msg string, errs ...error) *Error

func NewUnexpected added in v0.12.0

func NewUnexpected(msg string, errs ...error) *Error

func (*Error) BizCode added in v0.6.0

func (e *Error) BizCode() int

func (*Error) Details added in v0.6.0

func (e *Error) Details() any

func (*Error) Error

func (e *Error) Error() string

func (*Error) HTTPCode added in v0.6.0

func (e *Error) HTTPCode() int

func (*Error) Is added in v0.6.0

func (e *Error) Is(target error) bool

func (*Error) Message

func (e *Error) Message() string

func (*Error) Unwrap added in v0.6.0

func (e *Error) Unwrap() error

func (*Error) WithDetails added in v0.6.0

func (e *Error) WithDetails(details any) *Error

func (*Error) WithHttpCode added in v1.1.0

func (e *Error) WithHttpCode(code int) *Error

func (*Error) Wrap added in v0.6.0

func (e *Error) Wrap(err error) *Error

Jump to

Keyboard shortcuts

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