errors

package
v0.0.0-...-f66ea8c Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 100
	// ErrKVNotFound
	ErrChunkNotFound  = &Error{Code: ecode.ErrChunkNotFound, HTTPStatusCode: http.StatusContinue, Description: "Chunk not found"}
	ErrNeedleNotFound = &Error{Code: ecode.ErrNeedleNotFound, HTTPStatusCode: http.StatusContinue, Description: "Needle not found"}
	// 200
	ErrNone    = &Error{Code: ecode.ErrNone, HTTPStatusCode: http.StatusOK, Description: "Request succeeded"}
	ErrCreated = &Error{Code: ecode.ErrCreated, HTTPStatusCode: http.StatusCreated, Description: "Created succeeded"}
	// 400
	ErrInvalidPath          = &Error{Code: ecode.ErrInvalidPath, HTTPStatusCode: http.StatusNotFound, Description: "The file path is not valid"}
	ErrInvalidDelete        = &Error{Code: ecode.ErrInvalidDelete, HTTPStatusCode: http.StatusBadRequest, Description: "There are files in the folder and cannot be deleted recursively"}
	ErrIllegalObjectName    = &Error{Code: ecode.ErrIllegalObjectName, HTTPStatusCode: http.StatusBadRequest, Description: "Illegal object name"}
	ErrIllegalBucketName    = &Error{Code: ecode.ErrIllegalBucketName, HTTPStatusCode: http.StatusBadRequest, Description: "Illegal bucket name"}
	ErrRouter               = &Error{Code: ecode.ErrRouter, HTTPStatusCode: http.StatusBadRequest, Description: "Router problem"}
	ErrChunkNotExist        = &Error{Code: ecode.ErrChunkNotExist, HTTPStatusCode: http.StatusNotFound, Description: "Chunk not exist"}
	ErrContentEncoding      = &Error{Code: ecode.ErrContentEncoding, HTTPStatusCode: http.StatusBadRequest, Description: "Content Encoding read error"}
	ErrObjectNotFound       = &Error{Code: ecode.ErrObjectNotFound, HTTPStatusCode: http.StatusNotFound, Description: "Object not found"}
	ErrInvalidContinueToken = &Error{Code: ecode.ErrInvalidContinueToken, HTTPStatusCode: http.StatusBadRequest, Description: "Invalid continue token"}

	// 500
	ErrKvSever              = &Error{Code: ecode.ErrKvSever, HTTPStatusCode: http.StatusInternalServerError, Description: "Key-value database error"}
	ErrNonApiErr            = &Error{Code: ecode.ErrNonApiError, HTTPStatusCode: http.StatusInternalServerError, Description: "Non api error return"}
	ErrFSServer             = &Error{Code: ecode.ErrFSServer, HTTPStatusCode: http.StatusInternalServerError, Description: "File system server error"}
	ErrProto                = &Error{Code: ecode.ErrProto, HTTPStatusCode: http.StatusInternalServerError, Description: "ProtoBuf error"}
	ErrEngineMaster         = &Error{Code: ecode.ErrEngineMaster, HTTPStatusCode: http.StatusInternalServerError, Description: "Engine master server error"}
	ErrEngineChunk          = &Error{Code: ecode.ErrEngineChunk, HTTPStatusCode: http.StatusInternalServerError, Description: "Engine chunk server error"}
	ErrChunkMisalignment    = &Error{Code: ecode.ErrChunkMisalignment, HTTPStatusCode: http.StatusInternalServerError, Description: "Chunk offset misalignment"}
	ErrMaster               = &Error{Code: ecode.ErrMaster, HTTPStatusCode: http.StatusInternalServerError, Description: "Master server error"}
	ErrVolumeMagic          = &Error{Code: ecode.ErrVolumeMagic, HTTPStatusCode: http.StatusInternalServerError, Description: "Volume check code error"}
	ErrVolumeCreateConflict = &Error{Code: ecode.ErrVolumeCreateConflict, HTTPStatusCode: http.StatusInternalServerError, Description: "Volume create error"}
	ErrVolumeNotFound       = &Error{Code: ecode.ErrVolumeNotFound, HTTPStatusCode: http.StatusNotFound, Description: "Volume not found"}
	ErrVolumeWrite          = &Error{Code: ecode.ErrVolumeWrite, HTTPStatusCode: http.StatusInternalServerError, Description: "Volume write error"}
	ErrVolumeRead           = &Error{Code: ecode.ErrVolumeRead, HTTPStatusCode: http.StatusInternalServerError, Description: "Volume read error"}
	ErrInvalidNeedle        = &Error{Code: ecode.ErrInvalidNeedle, HTTPStatusCode: http.StatusInternalServerError, Description: "Invalid needle"}
	ErrVolumeIDInvalid      = &Error{Code: ecode.ErrVolumeIDInvalid, HTTPStatusCode: http.StatusInternalServerError, Description: "Invalid volume id"}
)

Functions

func As

func As(err error, target any) bool

func Cause

func Cause(err error) error

func Errorf

func Errorf(format string, args ...any) error

func Is

func Is(err, target error) bool

func New

func New(message string) error

func Unwrap

func Unwrap(err error) error

func WithMessage

func WithMessage(err error, message string) error

func WithStack

func WithStack(err error) error

func Wrap

func Wrap(err error, message string) error

func Wrapf

func Wrapf(err error, format string, args ...any) error

Types

type Error

type Error struct {
	ecode.Code
	HTTPStatusCode int
	Description    string
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) ErrorCode

func (e *Error) ErrorCode() ecode.Code

func (*Error) Format

func (e *Error) Format(s fmt.State, verb rune)

func (*Error) IsServerErr

func (e *Error) IsServerErr() bool

func (*Error) WarpErr

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

func (*Error) WithMessage

func (e *Error) WithMessage(msg string) error

func (*Error) WithMessagef

func (e *Error) WithMessagef(format string, args ...any) error

func (*Error) Wrap

func (e *Error) Wrap(msg string) error

func (*Error) Wrapf

func (e *Error) Wrapf(format string, args ...any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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