errors

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) codes.Code

Code returns the error code for the given error. If the error is not a flux.Error, this will return Unknown for the code. If the error is a flux.Error and its code is Inherit, then this will return the wrapped error's code.

func New

func New(code codes.Code, msg ...interface{}) error

func Newf

func Newf(code codes.Code, fmtStr string, args ...interface{}) error

func Wrap

func Wrap(err error, code codes.Code, msg ...interface{}) error

func Wrapf

func Wrapf(err error, code codes.Code, format string, a ...interface{}) error

Types

type Error

type Error struct {
	// Code is the code of the error as defined in the codes package.
	// This describes the type and category of the error. It is required.
	Code codes.Code

	// Msg contains a human-readable description and additional information
	// about the error itself. This is optional.
	Msg string

	// Err contains the error that was the cause of this error.
	// This is optional.
	Err error
}

Error is the error struct of flux.

func (*Error) Error

func (e *Error) Error() string

Error implement the error interface by outputting the Code and Err.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap will return the wrapped error.

Jump to

Keyboard shortcuts

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