errors

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README

errors

Golang SpiralScout errors package, fully compatible with the standard errors. Include stacktrace and operations.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Separator = ":\n\t"

separator -> new line plus tabulator to intend error if previous not nil

Functions

func E

func E(args ...interface{}) error

E builds an error value from its arguments.

func Errorf

func Errorf(format string, args ...interface{}) error

func Is

func Is(kind Kind, err error) bool

Is reports whether err is an *Error of the given Kind

func MarshalError

func MarshalError(err error) []byte

func MarshalErrorAppend

func MarshalErrorAppend(err error, b []byte) []byte

func Match

func Match(err1, err2 error) bool

func SafelyDo

func SafelyDo(work func())

Do smt with no care about result (and panics)

func Str

func Str(text string) error

errors.New

func UnmarshalError

func UnmarshalError(b []byte) error

Types

type Error

type Error struct {
	Op     Op
	Kind   Kind
	Err    error
	Raised string
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) MarshalAppend

func (e *Error) MarshalAppend(b []byte) []byte

func (*Error) MarshalBinary

func (e *Error) MarshalBinary() ([]byte, error)

func (*Error) UnmarshalBinary

func (e *Error) UnmarshalBinary(b []byte) error

type Kind

type Kind uint8
const (
	Undefined Kind = iota
	TimeOut
	Network
)

General 0 - 99

const (
	Register Kind = iota + 100
	Providers
	Logger
	ArgType
	Init
	Serve
	Unsupported
	Disabled
	Traverse
	FunctionCall
)

Endure Kinds of errors. 100 - 199

const (
	ErrWatcherStopped Kind = iota + 200
	Exec
)

RR kinds 200 - 299

func (Kind) String

func (k Kind) String() string

type Op

type Op string

Op describes an operation

Jump to

Keyboard shortcuts

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