apperr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package apperr provides application errors that combine a typed sentinel, optional context, and an optional wrapped cause.

Sentinels must be comparable errors, usually package-local string types with const values. Error unwraps to both the sentinel and the wrapped cause, so callers normally classify failures with errors.Is and the package sentinel.

Callers that need typed app-error metadata can name *apperr.Error[pkg.ErrKind] directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppErrMsg

func AppErrMsg[S sentinel](sentinel S, msg string) error

func AppErrMsgf

func AppErrMsgf[S sentinel](sentinel S, format string, args ...any) error

func AppErrWrap

func AppErrWrap[S sentinel](sentinel S, err error) error

func AppErrWrapf

func AppErrWrapf[S sentinel](sentinel S, err error, format string, args ...any) error

Types

type Error

type Error[S sentinel] struct {
	// contains filtered or unexported fields
}

func (*Error[S]) Error

func (e *Error[S]) Error() string

func (*Error[S]) Sentinel

func (e *Error[S]) Sentinel() S

func (*Error[S]) Unwrap

func (e *Error[S]) Unwrap() []error

Jump to

Keyboard shortcuts

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