failure

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package failure defines application failure kinds without transport policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(err error) string

Format provides a stable diagnostic when an adapter needs the kind.

func Is

func Is(err error, kind Kind) bool

Is reports whether err carries kind.

func NotFound

func NotFound(err error) error

NotFound classifies err as an absent requested object.

Types

type Error

type Error struct {
	Kind Kind
	Err  error
}

Error attaches a product failure kind while preserving its cause.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind string

Kind classifies a product failure for adapter-specific projection.

const (
	// KindNotFound identifies an absent requested product object.
	KindNotFound Kind = "not_found"
)

Jump to

Keyboard shortcuts

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