Documentation
¶
Index ¶
- Constants
- func AddContext(ctx context.Context, err error) error
- func AddErrLocalize(err error, localize *i18n.Localize) error
- func AddErrLocalizeData(err error, data map[string]any) error
- func AddErrLocalizePluralCount(err error, pluralCount any) error
- func AddErrorCode(err error, code int) error
- func AddErrorData(err error, field string, data any) error
- func DomainErrWithCode(msg string, code int) error
- func DomainErrWithCodeT(msg, msgID string, code int) error
- func DomainErrWithDefaultCode(msg string) error
- func DomainErrWithDefaultCodeT(msg, msgID string) error
- func GetContext(err error) context.Context
- func GetErrorCode(err error) int
- func GetErrorData(err error, key string) any
- func Handle(err error) error
- func IsDebugError(err error) bool
- func IsDomainError(err error) bool
- func IsRuntimeError(err error) bool
- func Log(err error)
- func New(msg string) error
- func NewTfDomainErrWidthCode(msg, msgID string, code int, namedArgs map[string]any, pluralCount any) error
- func Newf(msg string, args ...any) error
- func NewfDomainErrWidthCode(msg string, code int, args ...any) error
- func Wrap(err error, msg string) error
- func Wrapf(err error, msg string, args ...any) error
- type ErrHandler
- type ErrType
- func (t ErrType) New(msg string) error
- func (t ErrType) NewT(msg, msgID string) error
- func (t ErrType) NewTf(msg, msgID string, namedArgs map[string]any, pluralCount any) error
- func (t ErrType) Newf(msg string, args ...any) error
- func (t ErrType) Wrap(err error, msg string) error
- func (t ErrType) WrapT(err error, msg, msgID string) error
- func (t ErrType) WrapTf(err error, msg, msgID string, namedArgs map[string]any, pluralCount any) error
- func (t ErrType) Wrapf(err error, msg string, args ...any) error
Constants ¶
View Source
const ( NoType = ErrType(iota) Runtime Domain Debug )
View Source
const ServerErrTitle = "Server error, please try again later"
View Source
const ValidationErrCode = 101
Variables ¶
This section is empty.
Functions ¶
func AddErrorCode ¶
func DomainErrWithCode ¶
func DomainErrWithCodeT ¶
func GetContext ¶
func GetErrorCode ¶
func GetErrorData ¶
func IsDebugError ¶
func IsDomainError ¶
func IsRuntimeError ¶
func NewTfDomainErrWidthCode ¶
Types ¶
type ErrHandler ¶
type ErrHandler struct {
// contains filtered or unexported fields
}
func InitHandler ¶
func (ErrHandler) Handle ¶
func (h ErrHandler) Handle(err error) error
func (ErrHandler) Log ¶
func (h ErrHandler) Log(err error)
Click to show internal directories.
Click to hide internal directories.