errors

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Classify added in v0.6.3

func Classify(err error, class api.Result) error

Classify annotates a given error with a error class.

func GetClass added in v0.6.3

func GetClass(err error) api.Result

GetClass returns the class of the error.

func IsRecoverable

func IsRecoverable(err error) bool

IsRecoverable returns true if the given error has been marked as recoverable.

func NonRecoverable

func NonRecoverable(err error) error

NonRecoverable annotates a given error as non-recoverable. It is equivalent to `RecoverableIf(err, false)`

func Recoverable

func Recoverable(err error) error

Recoverable annotates a given error as recoverable. It is equivalent to `RecoverableIf(err, true)`

func RecoverableIf

func RecoverableIf(err error, cond bool) error

RecoverableIf conditionally annotates a given error as recoverable. If err is nil, the function returns nil. If the recoverability status of err is equal to cond, the function returns err itself. Otherwise a new error is returned that wraps err.

Types

This section is empty.

Jump to

Keyboard shortcuts

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