Documentation
¶
Index ¶
- func As(err error, target interface{}) bool
- func Errorf(format string, args ...interface{}) error
- func FormatErrorContext(err error) string
- func FormatErrorDetails(err error) string
- func FormatErrorStack(err error) string
- func Is(err, target error) bool
- func Join(errs ...error) error
- func New(message string, attrs ...ErrorAttribute) error
- func Report(ctx context.Context, err error)
- func ReportWithSeverity(ctx context.Context, err error, severity Severity)
- func SlogErr(err error) slog.Attr
- func Wrap(err error, attrs ...ErrorAttribute) error
- func WrapStackf(err error, format string, args ...interface{}) error
- func WrapWithStack(err error, stackattr ErrorAttribute, attrs ...ErrorAttribute) error
- type AttributeType
- type Detail
- type Details
- type ErrorAttribute
- func Int(key string, value int) ErrorAttribute
- func Int64(key string, value int64) ErrorAttribute
- func KeyedStackf(key, format string, args ...interface{}) ErrorAttribute
- func Stackf(format string, args ...interface{}) ErrorAttribute
- func String(key, value string) ErrorAttribute
- func StringPtr(key string, value *string) ErrorAttribute
- func Stringf(key, format string, args ...interface{}) ErrorAttribute
- func Uint64(key string, value uint64) ErrorAttribute
- type ErrorAttributes
- type ErrorDetailer
- type ErrorMessage
- type Severity
- type WrapConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatErrorContext ¶
FormatErrorContext renders only explicit Stackf operation breadcrumbs from the complete error chain. It does not include semantic details or frames.
func FormatErrorDetails ¶
FormatErrorDetails renders a deterministic, bounded semantic cause trace. It supports both single-cause chains and joined errors and never mutates the supplied error values.
func FormatErrorStack ¶
FormatErrorStack renders captured runtime frames from the complete error chain. It does not include semantic details or operation breadcrumbs.
func New ¶
func New(message string, attrs ...ErrorAttribute) error
func ReportWithSeverity ¶
func Wrap ¶
func Wrap(err error, attrs ...ErrorAttribute) error
func WrapStackf ¶
func WrapWithStack ¶
func WrapWithStack(err error, stackattr ErrorAttribute, attrs ...ErrorAttribute) error
Types ¶
type AttributeType ¶
type AttributeType uint8
const ( UnknownAttributeType AttributeType = iota StringAttributeType Uint64AttributeType Int64AttributeType StackAttributeType StringPtrAttributeType NoOpStackAttributeType )
type Detail ¶
Detail is one safe, ordered diagnostic field exposed by a typed error. Keys should use [a-z][a-z0-9_.]*. Values must not contain secrets or other data that is unsafe to publish to observability systems.
type Details ¶
Details is a typed error's semantic observability projection. Type is a stable snake_case identity; it is not derived from a Go type name. Fields retain their declaration order.
type ErrorAttribute ¶
type ErrorAttribute struct {
// contains filtered or unexported fields
}
func Int ¶
func Int(key string, value int) ErrorAttribute
func Int64 ¶
func Int64(key string, value int64) ErrorAttribute
func KeyedStackf ¶
func KeyedStackf(key, format string, args ...interface{}) ErrorAttribute
func Stackf ¶
func Stackf(format string, args ...interface{}) ErrorAttribute
func String ¶
func String(key, value string) ErrorAttribute
func StringPtr ¶
func StringPtr(key string, value *string) ErrorAttribute
func Stringf ¶
func Stringf(key, format string, args ...interface{}) ErrorAttribute
func Uint64 ¶
func Uint64(key string, value uint64) ErrorAttribute
type ErrorAttributes ¶
type ErrorAttributes []ErrorAttribute
func (ErrorAttributes) ErrorAttributes ¶
func (attrs ErrorAttributes) ErrorAttributes() map[string]interface{}
func (ErrorAttributes) SlogAttrs ¶
func (attrs ErrorAttributes) SlogAttrs() []slog.Attr
type ErrorDetailer ¶
type ErrorDetailer interface {
ErrorDetails() Details
}
ErrorDetailer exposes safe semantic facts for diagnostic rendering. Application control flow should continue to classify errors with Is and As against concrete sentinels and types, not with Details.Type.
type ErrorMessage ¶
type ErrorMessage string
func (ErrorMessage) Error ¶
func (e ErrorMessage) Error() string
type WrapConfig ¶
type WrapConfig struct {
Error error
Stack ErrorAttribute
Attributes []ErrorAttribute
}