errlvl

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(err error, level Lvl) error

Wrap wraps the given error with the given level.

Types

type ErrorLevel

type ErrorLevel error

ErrorLevel is a type that represents the severity of an error in the application.

This is the global error levels that should be used throughout the application to determine the severity of the error.

var (
	ErrDebug ErrorLevel = errors.New("[DEBUG]") // ErrDebug is returned when the global level is set to DEBUG.
	ErrInfo  ErrorLevel = errors.New("[INFO]")  // ErrInfo is returned when the global level is set to INFO.
	ErrWarn  ErrorLevel = errors.New("[WARN]")  // ErrWarn is returned when the global level is set to WARN.
	ErrError ErrorLevel = errors.New("[ERROR]") // ErrError is returned when the global level is set to ERROR.
	ErrFatal ErrorLevel = errors.New("[FATAL]") // ErrFatal is returned when the global level is set to FATAL.
)

type Lvl

type Lvl uint8
const (
	DEBUG Lvl = iota + 1
	INFO
	WARN
	ERROR
	FATAL
)

Jump to

Keyboard shortcuts

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