error

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	I18nLanguageEn = "en"
	I18nLanguageCh = "ch"
)
View Source
const (
	StatusErrorUnknown = -1
)

Variables

This section is empty.

Functions

func GetI18nMessage

func GetI18nMessage(ctx context.Context, key StatusErrorKey) (string, error)

func GetI18nMessageF

func GetI18nMessageF(ctx context.Context, key StatusErrorKey, args interface{}) (string, error)

func InjectI18nCollection

func InjectI18nCollection(location string, collections map[StatusErrorKey]string)

func NewInternalError

func NewInternalError(err error) error

Types

type StatusError

type StatusError struct {
	Code    StatusErrorKey
	Message string
}

func AuthErrorFromString

func AuthErrorFromString(str string) (*StatusError, error)

func NewStatusError

func NewStatusError(ctx context.Context, code StatusErrorKey) *StatusError

func NewStatusErrorF

func NewStatusErrorF(ctx context.Context, code StatusErrorKey, args interface{}) *StatusError

func (StatusError) Error

func (a StatusError) Error() string

func (StatusError) ProtoError

func (a StatusError) ProtoError() error

type StatusErrorKey

type StatusErrorKey int

Jump to

Keyboard shortcuts

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