apierrors

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeInternal = 900
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ErrorCode    int
	ErrorMessage string
	Details      map[string]interface{} `json:",omitempty"`
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) *Error

func New

func New(
	grpcStatusCode codes.Code,
	errorCode int,
	errorMessage string,
	err error,
) Error

func NewBusinessError

func NewBusinessError(errorCode int, errorMessage string, err error) Error

func NewInternalServiceError

func NewInternalServiceError(err error) Error

func (Error) Error

func (e Error) Error() string

func (Error) GrpcStatusError

func (e Error) GrpcStatusError() error

func (Error) LogLevel

func (e Error) LogLevel() log.Level

func (Error) WithDetails

func (e Error) WithDetails(details map[string]any) Error

func (Error) WithLogLevel

func (e Error) WithLogLevel(level log.Level) Error

Jump to

Keyboard shortcuts

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