protocolerrors

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

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

Errorf formats according to a format specifier and returns the string as a ProtocolError.

func New

func New(shouldBan bool, message string) error

New returns a ProtocolError with the supplied message. New also records the stack trace at the point it was called.

func Wrap

func Wrap(shouldBan bool, err error, message string) error

Wrap wraps the given error and returns it as a ProtocolError.

func Wrapf

func Wrapf(shouldBan bool, err error, format string, args ...interface{}) error

Wrapf wraps the given error with the given format and returns it as a ProtocolError.

Types

type ProtocolError

type ProtocolError struct {
	ShouldBan bool
	Cause     error
}

ProtocolError is an error that signifies a violation of the peer-to-peer protocol

func (ProtocolError) Error

func (e ProtocolError) Error() string

func (ProtocolError) Unwrap

func (e ProtocolError) Unwrap() error

Unwrap returns the cause of ProtocolError, to be used with `errors.Unwrap()`

Jump to

Keyboard shortcuts

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