errors

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorToGRPCError

func ErrorToGRPCError(err error) error

Types

type Code

type Code int32
const (
	Unknown Code = iota + 1
	InvalidArgument
	NotFound
	AlreadyExists
	PermissionDenied
	Internal
	Unavailable
)

type Error

type Error struct {
	Code Code

	Details map[string]string
	// contains filtered or unexported fields
}

func NewAlreadyExistsError

func NewAlreadyExistsError(err error) *Error

func NewError

func NewError(code Code, err error) *Error

func NewInternalError

func NewInternalError(err error) *Error

func NewInvalidError

func NewInvalidError(err error) *Error

func NewNotFoundError

func NewNotFoundError(err error) *Error

func NewPermissionDeniedError

func NewPermissionDeniedError(err error) *Error

func NewUnavailableError

func NewUnavailableError(err error) *Error

func NewUnknownError

func NewUnknownError(err error) *Error

func (*Error) AddDetail

func (e *Error) AddDetail(key, value string) *Error

func (*Error) AddDetails

func (e *Error) AddDetails(details map[string]string) *Error

func (*Error) CodeToGRPCCode

func (e *Error) CodeToGRPCCode() codes.Code

func (*Error) DetailsToGRPCDetails

func (e *Error) DetailsToGRPCDetails() proto.Message

func (Error) Error

func (e Error) Error() string

func (*Error) SetDetails

func (e *Error) SetDetails(details map[string]string) *Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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