Documentation
¶
Overview ¶
Package safeerror redacts extension failures without adding classifications.
Index ¶
- func AttributeSource(err error) error
- func Attributes(err error) []fault.Attribute
- func Diagnostic(message string, cause error) error
- func FaultDiagnostic(err error) (fault.Note, []fault.Frame, bool)
- func HasCode(err error, code fault.Code) bool
- func IsDiagnostic(err error) bool
- func IsPanic(err error) bool
- func Join(fallback string, failures ...error) error
- func New(message string) error
- func NewFault(code fault.Code, message string) error
- func Owned(message string, cause error) error
- func OwnedMessage(err error) (string, bool)
- func Panic(message string, frames []fault.Frame) error
- func Prefix(operation string, cause error) error
- func Retain(original, result error) error
- func Reveal(message string, foreign error) error
- func Seal(message string, cause error) error
- func SealMatching(message string, cause, match error) error
- func Sentinel(code fault.Code, message string) *fault.Error
- func UnwrapOwned(err error) error
- func WithAttributes(err, source error, attributes []fault.Attribute) error
- func Wrap(message string, cause error) error
- func WrapFailure(code fault.Code, message string, cause error) error
- func WrapFault(code fault.Code, message string, cause error) error
- type DiagnosticID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributeSource ¶
AttributeSource identifies the construction owner shared by transparent views. Distinct failures may carry equal attribute keys and values.
func Attributes ¶
func Diagnostic ¶
Diagnostic retains a cause for errors.Is/As that must not supply an HTTP classification. Use only where retaining a previously discarded cause.
func FaultDiagnostic ¶
FaultDiagnostic reads only an immutable construction snapshot. The cause may expose a mutable public fault for identity; it is not a diagnostic authority.
func IsDiagnostic ¶
IsDiagnostic identifies the framework-owned boundary without calling error methods.
func Join ¶
Join retains immutable diagnostics across cleanup aggregation. Unmarked siblings contribute only fallback text; every original cause remains in order. A single failure keeps its exact identity, including unmarked failures.
func NewFault ¶
NewFault snapshots a diagnostic at its framework construction site. Unlike recognizing an arbitrary *fault.Error later, this cannot trust application messages or an application mutation of an exposed fault.
func Owned ¶
Owned marks an immutable diagnostic produced by a framework owner. Callback containment can retain this text without inspecting or formatting the cause. Never derive message from an application error or an already-exposed fault.
func OwnedMessage ¶
OwnedMessage recognizes only concrete framework markers and capsules carrying their captured text. It never walks causes or invokes application methods.
func Panic ¶
Panic snapshots source locations at the recovery owner, never from an application-returned fault or recovered payload.
func Retain ¶
Retain reattaches an already captured diagnostic after an owner adds outcome or cleanup causes. It neither inspects nor replaces that returned cause graph.
func Reveal ¶
Reveal exposes sealed causes only after leaving the foreign library. The projection is lazy: constructing it calls no application methods. Subsequent framework inspection must use bounded errorgraph traversal inside containment.
func Seal ¶
Seal keeps application causes opaque to foreign-library formatting and error inspection. Reveal restores them after the foreign operation has returned.
func SealMatching ¶
SealMatching preserves one already-established framework control sentinel without allowing the foreign library to inspect the original cause.
func Sentinel ¶
Sentinel constructs a framework sentinel with immutable diagnostic metadata. Use only for package-level constants, never for per-operation failures.
func UnwrapOwned ¶
UnwrapOwned removes only a source-issued immutable marker. It does not walk arbitrary causes or call application methods. Typed owners can use it where they previously checked a direct concrete result from another framework owner.
func WithAttributes ¶
WithAttributes captures attributes at their trusted construction owner. Values must be framework vocabulary, never application text or adapter metadata.
func Wrap ¶
Wrap retains cause for inspection without invoking its formatting methods. A nil cause stays nil; message must be framework-owned diagnostic text.
func WrapFailure ¶
WrapFailure adds an operation classification and a fallback diagnostic while retaining a more specific diagnostic already captured by a framework owner.
Types ¶
type DiagnosticID ¶
type DiagnosticID struct {
// contains filtered or unexported fields
}
DiagnosticID identifies one immutable construction snapshot. Transparent wrappers share it; distinct constructions keep distinct identities.
func FaultDiagnosticID ¶
func FaultDiagnosticID(err error) DiagnosticID