errors

package
v0.0.0-...-a2bc238 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBadRequestError

func IsBadRequestError(err error) bool

IsBadRequestError judges error is errBadRequest

func IsClientError

func IsClientError(err error) bool

IsClientError judeges error is IsClientError

func IsConflictError

func IsConflictError(err error) bool

IsConflictError judges error is errConflict

func IsDBError

func IsDBError(err error) bool

func IsForbiddenError

func IsForbiddenError(err error) bool

IsForbiddenError judges error is errForbidden

func IsInvalidRegionError

func IsInvalidRegionError(err error) bool

IsInvalidRegionError judges error is errInvalidRegion

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError judges error is errNotFound

func IsNotReadyError

func IsNotReadyError(err error) bool

IsNotReadyError judges error is errNotReady

func IsParamError

func IsParamError(err error) bool

func IsServerError

func IsServerError(err error) bool

func IsTaskIsRunningError

func IsTaskIsRunningError(err error) bool

IsTaskIsRunningError judges error is errTaskIsRunning

func New

func New(text string) error

New returns an error that formats as the given text.

func NewBadRequestError

func NewBadRequestError(message string) error

NewBadRequestError create a new not found error

func NewConflictError

func NewConflictError(resource string) error

NewConflictError create a new conflict error

func NewDBError

func NewDBError(message string) error

func NewForbiddenError

func NewForbiddenError(message string) error

NewForbiddenError create a new not found error

func NewInvalidRegionError

func NewInvalidRegionError(region string) error

NewInvalidRegionError create a new not found error

func NewNotFoundError

func NewNotFoundError(resource string) error

NewNotFoundError create a new not found error

func NewNotReadyError

func NewNotReadyError(resource string) error

NewNotReadyError create a new not ready error

func NewParamError

func NewParamError(message string) error

func NewTaskIsRunningError

func NewTaskIsRunningError(message string) error

NewTaskIsRunningError create a new task is running error

Types

type ClientError

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

ClientError is an error caused by request client

func NewClientError

func NewClientError(msg string) *ClientError

NewClientError return a ClientError with the msg

func (*ClientError) Error

func (err *ClientError) Error() string

type Error

type Error struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func ErrSwitch

func ErrSwitch(err error) Error

func (Error) Error

func (e Error) Error() string

type ServerError

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

ServerError is an error caused by request client

func NewServerError

func NewServerError(msg string) *ServerError

NewServerError return a ServerError with the msg

func (*ServerError) Error

func (err *ServerError) Error() string

Jump to

Keyboard shortcuts

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