errdef

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(err error, code Code) bool

func Message

func Message(err error) string

func New

func New(code Code, format string, args ...interface{}) error

func Wrap

func Wrap(code Code, err error, format string, args ...interface{}) error

Types

type Code

type Code string
const (
	CodeUnknown    Code = "unknown"
	CodeParse      Code = "parse"
	CodeHTTP       Code = "http"
	CodeFilesystem Code = "filesystem"
	CodeScript     Code = "script"
	CodeHistory    Code = "history"
	CodeUI         Code = "ui"
)

func CodeOf

func CodeOf(err error) Code

type Error

type Error struct {
	Code    Code
	Message string
	Err     error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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