serror

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: BSD-2-Clause, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStorageOSError

func IsStorageOSError(err error) bool

Types

type StorageOSError

type StorageOSError interface {
	// embedding error provides compatibility with standard error handling code
	error

	// Encoding/decoding methods to help errors traverse API boundaries
	json.Marshaler
	json.Unmarshaler

	Err() error               // Returns the underlying error that caused this event
	String() string           // A short string representing the error (for logging etc)
	Help() string             // A larger string that should provide informative debug instruction to users
	Kind() StorageOSErrorKind // A type representing a set of known error conditions, helpful to switch on
	Extra() map[string]string // A container for error specific information

}

func NewTypedStorageOSError

func NewTypedStorageOSError(kind StorageOSErrorKind, err error, msg string, help string) StorageOSError

func NewUntypedStorageOSError

func NewUntypedStorageOSError(err error, msg string, help string) StorageOSError

type StorageOSErrorKind

type StorageOSErrorKind int
const (
	UnknownError StorageOSErrorKind = iota
	APIUncontactable
	InvalidHostConfig
)

Known error kinds

func ErrorKind

func ErrorKind(err error) StorageOSErrorKind

func (*StorageOSErrorKind) MarshalJSON

func (s *StorageOSErrorKind) MarshalJSON() ([]byte, error)

func (StorageOSErrorKind) String

func (i StorageOSErrorKind) String() string

func (*StorageOSErrorKind) UnmarshalJSON

func (s *StorageOSErrorKind) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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