failure

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReason

func NewReason(message, reason string) error

NewReason creates a new error using message and wraps it with reason. The reason can be extracted using Reason().

func Reason

func Reason(err error) (string, bool)

Reason extracts a failure reason from err. err has a reason if it satisfies the failure reason interface:

interface {
	FailureReason() string
}

If err does not have a reason or FailureReason() returns an empty string, ReasonUnknown is returned.

func WithReason

func WithReason(err error, reason string) error

WithReason decorates err with reason. The reason can be extracted using Reason().

Types

This section is empty.

Jump to

Keyboard shortcuts

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