errtype

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error is a reusable sentinel error that supports WithMessage while remaining compatible with errors.Is against the bare sentinel.

func (Error) Error

func (e Error) Error() string

Error implements the error interface.

func (Error) WithMessage

func (e Error) WithMessage(msg string) WithMessageError

WithMessage attaches detail text (typically cause.Error()). An empty message returns the sentinel itself.

func (Error) WithMessageFmt

func (e Error) WithMessageFmt(format string, args ...any) WithMessageError

WithMessageFmt attaches detail text (typically cause.Error()). An empty message returns the sentinel itself.

func (Error) Wrap

func (e Error) Wrap(err error) error

Wrap attaches err as a cause. errors.Is matches the sentinel and err. A nil err returns the sentinel itself.

type WithMessageError

type WithMessageError interface {
	error
	WithMessage(msg string) WithMessageError
	WithMessageFmt(format string, args ...any) WithMessageError
}

Jump to

Keyboard shortcuts

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