failure

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCode

func IsCode(err error, code string) bool

Types

type Refusal

type Refusal struct {
	Code   string
	Root   string
	Path   string
	Reason string
	Next   string
}

Refusal is the shared fail-closed error returned at trust boundaries.

func New

func New(code, root, path, reason, next string) *Refusal

New builds a refusal. Every refusal owes the caller one legal recovery action, so an empty code, reason, or next is a construction bug rather than a runtime condition: refusing without a way forward is the dead end the fail-closed contract exists to prevent. Panic keeps that undetectable in tests instead of shipping a dead end to an agent or a person.

func (*Refusal) Error

func (r *Refusal) Error() string

Jump to

Keyboard shortcuts

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