failure

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitUnexpected     = 1
	ExitUsage          = 2
	ExitDependency     = 3
	ExitInput          = 4
	ExitOutputConflict = 5
	ExitConversion     = 6
	ExitInterrupted    = 130
)

Variables

This section is empty.

Functions

func Detail added in v0.5.0

func Detail(err error) string

Detail returns the underlying diagnostic that --verbose reveals, or an empty string when the cause says nothing the message has not already said.

func Details

func Details(err error) (message, hint string)

func ExitCode

func ExitCode(err error) int

func Format

func Format(err error, verbose bool) string

func IsReported

func IsReported(err error) bool

func New

func New(kind Kind, message, hint string, err error) error

func Reported

func Reported(err error) error

func Wrap

func Wrap(kind Kind, message string, err error) error

Types

type Error

type Error struct {
	Kind    Kind
	Message string
	Hint    string
	Err     error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind int
const (
	Unexpected Kind = iota
	Usage
	Dependency
	Input
	OutputConflict
	Conversion
	Interrupted
)

Jump to

Keyboard shortcuts

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