errs

package
v0.0.0-...-d63482c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingConfig = errors.New("config is missing")
)

Functions

func IsConnClosedErr

func IsConnClosedErr(err error) bool

IsConnClosedErr returns true if err indicates a closed connection error.

func NewSilentErr

func NewSilentErr(format string, a ...any) error

func V

func V(log logr.Logger, err error) logr.Logger

V returns a new Logger instance with the specific verbosity level specified if the error is a VerbosityError. See logr.Logger#V().

func WrapSilent

func WrapSilent(wrappedErr error) error

Types

type SilentError

type SilentError struct{ Err error }

SilentError is an error wrapper type that silences an error and only logs them in the debug log.

It is usually used to prevent spamming the default log when Minecraft clients send invalid packets which cannot be read.

func (*SilentError) Error

func (e *SilentError) Error() string

func (*SilentError) Unwrap

func (e *SilentError) Unwrap() error

type VerbosityError

type VerbosityError struct {
	Err       error
	Verbosity int
}

VerbosityError is an error wrapper that specifies the log verbosity of the wrapped error.

func (*VerbosityError) Error

func (e *VerbosityError) Error() string

func (*VerbosityError) Unwrap

func (e *VerbosityError) Unwrap() error

Jump to

Keyboard shortcuts

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