errs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGRPCErrorContext

func GetGRPCErrorContext(err error) map[string]any

GetGRPCErrorContext extracts the context from a GRPCError if it exists in a joined error chain.

func IsAnyError

func IsAnyError(err error, targets ...error) bool

func Wrap

func Wrap(base, ext error) error

func Wrapf

func Wrapf(base error, str string) error

Types

type GRPCError

type GRPCError struct {
	Code        GRPCErrorCode
	BaseMessage string
	Reason      string
	Metadata    map[string]string
}

GRPCError represents a structured error for gRPC responses. The error can be matched using errors.Is and errors.As.

func (GRPCError) As

func (e GRPCError) As(target any) bool

func (GRPCError) Error

func (e GRPCError) Error() string

func (GRPCError) FromStatusError

func (e GRPCError) FromStatusError(err error) GRPCError

func (GRPCError) Is

func (e GRPCError) Is(target error) bool

type GRPCErrorCode

type GRPCErrorCode string

type JoinedError

type JoinedError interface {
	Unwrap() []error
}

Jump to

Keyboard shortcuts

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