errors

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 1 Imported by: 44

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 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