errors

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) codes.Code

func IsHandledCode

func IsHandledCode(code codes.Code) bool

Types

type Error

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

func Cast

func Cast(err error) *Error

func New

func New(code codes.Code) *Error

func NewWithSlug

func NewWithSlug(code codes.Code, slug string) *Error

func Wrap

func Wrap(err error, code codes.Code) *Error

func WrapWithSlug

func WrapWithSlug(err error, code codes.Code, slug string) *Error

func (Error) Code

func (e Error) Code() codes.Code

func (Error) Details

func (e Error) Details() []string

func (Error) Error

func (e Error) Error() string

func (Error) GRPCStatus

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

func (Error) IsHandled

func (e Error) IsHandled() bool

func (Error) Localize

func (e Error) Localize() string

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

func (Error) MarshalXML

func (e Error) MarshalXML(encoder *xml.Encoder, start xml.StartElement) error

func (Error) MarshalYAML

func (e Error) MarshalYAML() (any, error)

func (Error) Message

func (e Error) Message() string

func (Error) Model

func (e Error) Model() *Model

func (Error) SetLocalize

func (e Error) SetLocalize(localize string) *Error

func (Error) Slug

func (e Error) Slug() string

func (Error) StatusCode

func (e Error) StatusCode() int

func (Error) WithDetailF

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

func (Error) WithDetails

func (e Error) WithDetails(details ...string) *Error

type Model

type Model struct {
	Code    uint32   `json:"code,omitempty" xml:"code,omitempty" yaml:"code,omitempty"`
	Message string   `json:"message,omitempty" xml:"message,omitempty" yaml:"message,omitempty"`
	Details []string `json:"details,omitempty" xml:"details,omitempty" yaml:"details,omitempty"`
}

Jump to

Keyboard shortcuts

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