errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// The operation was cancelled, typically by the caller.
	StatusClientClosed = 499
)

Variables

This section is empty.

Functions

func NewDebugInfo

func NewDebugInfo(stacks []string, msg string) *errdetails.DebugInfo

func NewLocalizedMsg

func NewLocalizedMsg(ctx context.Context, msg Message) *errdetails.LocalizedMessage

func NewLocalizedMsgWithLang

func NewLocalizedMsgWithLang(languages []string, msg Message) *errdetails.LocalizedMessage

func NewReason

func NewReason(reason Reason, meta map[string]string) *errdetails.ErrorInfo

Types

type Error

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

func Errorf

func Errorf(code code.Code, msg string, details ...proto.Message) *Error

func FromError

func FromError(err error) *Error

func FromProto

func FromProto(stu *status.Status) *Error

func New

func New(code code.Code, err error, details ...proto.Message) *Error

func (*Error) Code

func (e *Error) Code() int32

func (*Error) Error

func (e *Error) Error() string

func (*Error) GRPCStatus

func (e *Error) GRPCStatus() *status.Status

func (*Error) HttpCode

func (e *Error) HttpCode() int32

func (*Error) Message

func (e *Error) Message() string

func (*Error) Stacks

func (e *Error) Stacks() []string

func (*Error) WithDetails

func (e *Error) WithDetails(details ...proto.Message)

func (*Error) WithStack

func (e *Error) WithStack()

type Message

type Message interface {
	Message(language string) string
}

type Reason

type Reason interface {
	Reason() string
	Domain() string
}

Jump to

Keyboard shortcuts

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