Documentation ¶
Index ¶
- func ConvertToBanningProtocolErrorIfRuleError(err error, format string, args ...interface{}) error
- func Errorf(shouldBan bool, format string, args ...interface{}) error
- func New(shouldBan bool, message string) error
- func Wrap(shouldBan bool, err error, message string) error
- func Wrapf(shouldBan bool, err error, format string, args ...interface{}) error
- type ProtocolError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToBanningProtocolErrorIfRuleError ¶
ConvertToBanningProtocolErrorIfRuleError converts the given error to a banning protocol error if it's a rule error, and otherwise keep it as is.
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a ProtocolError.
func New ¶
New returns a ProtocolError with the supplied message. New also records the stack trace at the point it was called.
Types ¶
type ProtocolError ¶
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()`
Click to show internal directories.
Click to hide internal directories.