Documentation
¶
Overview ¶
Package callback isolates extension failures without formatting panic payloads.
Index ¶
- func ErrorAs(err error, target any) bool
- func ErrorAsResult(err error, target any) (bool, error)
- func ErrorIs(err, target error) bool
- func ErrorIsResult(err, target error) (matched bool, failed error)
- func ErrorWalk(err error, visit func(error) bool) bool
- func Invoke(operation string, fn func() error) (err error)
- func Isolated(operation string, fn func() error) error
- func RetainDiagnostic(foreign, result error) error
- func Returned(operation string, err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAs ¶
ErrorAs publishes a match only after inspection returned normally. The target is untouched on panic, Goexit, exhaustion, a nonmatch or a nil match. A nil detail cannot establish a framework classification.
func ErrorAsResult ¶
ErrorAsResult publishes a match only after completed inspection, and retains failed inspection separately so callers cannot normalize it as bad input.
func ErrorIs ¶
ErrorIs bounds and contains application matching methods. Incomplete or failed inspection establishes no match; the original error remains a failure.
func ErrorIsResult ¶
ErrorIsResult distinguishes a completed nonmatch from failed inspection.
func ErrorWalk ¶
ErrorWalk contains a bounded graph walk. Visitors must treat their collected results as provisional until this returns true.
func Invoke ¶
Invoke catches panics and preserves ordinary callback error identity. runtime.Goexit still exits this goroutine; use Isolated when it must be caught. A contained panic keeps its source frames, never its recovered value.
func Isolated ¶
Isolated runs a callback in an owned goroutine and waits for its actual exit. It catches Goexit as well as panic. It never abandons an uncooperative callback or claims its resources have been released when it is still running.
func RetainDiagnostic ¶
RetainDiagnostic recovers a source-issued immutable marker hidden by a foreign wrapper after the foreign operation finishes. Inspection is bounded and contained; it never formats errors or opens opaque application capsules. The complete result, including outcome and cleanup causes, is preserved.
Types ¶
This section is empty.