apperr

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(err error, fallbackPrefix string) string

func IsKind

func IsKind(err error, kind Kind) bool

func New

func New(display string) error

func NewKind

func NewKind(kind Kind, display string) error

func NewKindf

func NewKindf(kind Kind, format string, args ...any) error

func Newf

func Newf(format string, args ...any) error

func Wrap

func Wrap(display string, err error) error

func WrapKind

func WrapKind(kind Kind, display string, err error) error

Types

type Error

type Error struct {
	Display string
	Kind    Kind
	Err     error
}

func (*Error) DisplayMessage

func (e *Error) DisplayMessage() string

func (*Error) Error

func (e *Error) Error() string

func (*Error) ErrorKind

func (e *Error) ErrorKind() Kind

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind string
const (
	KindUnknown    Kind = ""
	KindCanceled   Kind = "canceled"
	KindConfig     Kind = "config"
	KindPermission Kind = "permission"
	KindProvider   Kind = "provider"
	KindSession    Kind = "session"
	KindToolInput  Kind = "tool_input"
	KindToolExec   Kind = "tool_exec"
)

func KindOf

func KindOf(err error) Kind

type UserError

type UserError interface {
	error
	DisplayMessage() string
}

UserError exposes a concise user-facing message while preserving the full wrapped error for logging and debugging.

Jump to

Keyboard shortcuts

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