errors

package
v0.0.0-...-843cdbd Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Type    Type   `bson:"type" json:"type"`
	Code    string `bson:"code"  json:"code"`
	Message string `bson:"message" json:"message"`

	Err error `bson:"-" json:"-"` // Native error
}

func Assert

func Assert(expect string, actual string, nativeErr ...error) *Error

func Of

func Of(t Type, code string, message string, nativeErr ...error) *Error

func Sys

func Sys(message string, nativeErr ...error) *Error

func Verify

func Verify(message string, nativeErr ...error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsApplication

func (e *Error) IsApplication() bool

func (*Error) IsCoding

func (e *Error) IsCoding() bool

func (*Error) IsSystem

func (e *Error) IsSystem() bool

func (*Error) Native

func (e *Error) Native() error

type Template

type Template struct {
	Code  string `json:"code"`
	Label string `json:"label"`
}

func NewTemplate

func NewTemplate(code string, label string) *Template

func (*Template) Error

func (t *Template) Error(args ...any) *Error

type Type

type Type = int32
const (
	Coding      Type = -999 // code error
	System      Type = -444 // system error
	Application Type = -777 // application error
)

Jump to

Keyboard shortcuts

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