appError

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int
const (
	Panic   Level = 10
	Alert   Level = 9
	Error   Level = 8
	Warning Level = 4
	Notice  Level = 3
	Info    Level = 0
	Debug   Level = -4
	Unknown Level = -10
)

func FromShortString

func FromShortString(shortString string) Level

func (Level) Int

func (el Level) Int() int

func (Level) Int8

func (el Level) Int8() int8

func (Level) ShortStr

func (el Level) ShortStr() string

func (Level) String

func (el Level) String() string

type Typ

type Typ struct {
	Level            Level
	Code             string // LMID
	Message          string // The actual error message
	HttpResponseCode int    // In case we are trying to use this type for returning a network error
	DevMsg           string // In case we are trying to use this type for returning a network error
	WrappedError     *Typ   // Any wrapped errors that we want to embed in this error
	ExtraData        string // When we need to pass more values (errors are values (as said by Rob Pike))
}
var BlankError Typ

func NewError

func NewError(errLevel Level, code string, msg string, wrappedError ...Typ) Typ

func NewNetworkError

func NewNetworkError(httpResponseCode int, errLvl Level, code string, msg string, devmsg string, wrappedError ...Typ) Typ

func (Typ) Error

func (e Typ) Error() string

func (Typ) IsBlank

func (e Typ) IsBlank() bool

func (Typ) IsBlankNetworkError

func (e Typ) IsBlankNetworkError() bool

func (Typ) IsNotBlank

func (e Typ) IsNotBlank() bool

func (Typ) IsNotBlankNetworkError

func (e Typ) IsNotBlankNetworkError() bool

func (Typ) String

func (e Typ) String() string

func (Typ) Wrap

func (e Typ) Wrap(wrappedErr Typ) Typ

func (Typ) WrapsErrorLevel

func (e Typ) WrapsErrorLevel(errLvl Level, checkCurrErr bool) bool

Jump to

Keyboard shortcuts

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