errorz

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingTransactions should be raised by an IsValidFunc if a proposal may
	// not be verified due to missing transactions.
	ErrMissingTransactions = errors.New("unable to verify: missing transactions")
	ErrBadResponse         = errors.New("bad response from p2p request to remote peer")
	ErrClosing             = errors.New("shutting down, halt actions")
	ErrCorrupt             = errors.New("something went wrong that requires shutdown")
)

Functions

func MakeTrace

func MakeTrace(atDepth int) string

Maketrace generates a file name + line number string tracing back to the calling code atDepth=0 traces to the call MakeTrace atDepth=1 traces to the call before that, useful for using maketrace inside reusable functions

Types

type Err

type Err struct {
	// contains filtered or unexported fields
}

func NewErr

func NewErr(msg string) *Err

func (*Err) Error

func (e *Err) Error() string

Error returns the error message and traces of this error and any wrapped errors

func (*Err) Trace

func (e *Err) Trace(suffix ...interface{}) *Err

Trace adds a trace line to this error with an optional suffix Suffix can be a single value, or an format string followed by format values

func (*Err) Unwrap

func (s *Err) Unwrap() error

Unwrap returns the wrapper (inner) error

func (*Err) Wrap

func (e *Err) Wrap(inner error) *Err

Wrap wraps this error around a given error

type ErrConsensus

type ErrConsensus struct {
	*Err
	// contains filtered or unexported fields
}

func NewErrConsensus

func NewErrConsensus(msg string, isLocal bool) *ErrConsensus

func (*ErrConsensus) Error

func (e *ErrConsensus) Error() string

func (*ErrConsensus) IsLocal

func (e *ErrConsensus) IsLocal() bool

func (*ErrConsensus) Trace

func (e *ErrConsensus) Trace(i ...interface{}) *ErrConsensus

func (*ErrConsensus) Wrap

func (e *ErrConsensus) Wrap(err error) *ErrConsensus

type ErrInvalid

type ErrInvalid struct {
	*Err
}

func NewErrInvalid

func NewErrInvalid(msg string) *ErrInvalid

func (*ErrInvalid) Error

func (e *ErrInvalid) Error() string

func (ErrInvalid) New

func (e ErrInvalid) New(msg string) *ErrInvalid

func (*ErrInvalid) Trace

func (e *ErrInvalid) Trace(i ...interface{}) *ErrInvalid

func (*ErrInvalid) Wrap

func (e *ErrInvalid) Wrap(err error) *ErrInvalid

type ErrStale

type ErrStale struct {
	*Err
}

func NewErrStale

func NewErrStale(msg string, v ...interface{}) *ErrStale

func (*ErrStale) Error

func (e *ErrStale) Error() string

func (ErrStale) New

func (e ErrStale) New(msg string, v ...interface{}) *ErrStale

func (*ErrStale) Trace

func (e *ErrStale) Trace(i ...interface{}) *ErrStale

func (*ErrStale) Wrap

func (e *ErrStale) Wrap(err error) *ErrStale

Jump to

Keyboard shortcuts

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