Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoOSDetected is the error for when no OS is detected.
	ErrNoOSDetected = ErrRexRay(ErrCodeNoOSDetected)

	// ErrNoVolumesDetected is the error for when no volumes are detected.
	ErrNoVolumesDetected = ErrRexRay(ErrCodeNoVolumesDetected)

	// ErrNoStorageDetected is the error for when no storage is detected.
	ErrNoStorageDetected = ErrRexRay(ErrCodeNoStorageDetected)

	// ErrDriverBlockDeviceDiscovery is the error for for when there
	// is an error discovering block devices.
	ErrDriverBlockDeviceDiscovery = ErrRexRay(ErrCodeDriverBlockDeviceDiscovery)

	// ErrDriverInstanceDiscovery is the error for when there is an
	// error discovering an instance.
	ErrDriverInstanceDiscovery = ErrRexRay(ErrCodeDriverInstanceDiscovery)

	// ErrDriverVolumeDiscovery is the error for when there is an
	// error discovering one or more volumes.
	ErrDriverVolumeDiscovery = ErrRexRay(ErrCodeDriverVolumeDiscovery)

	// ErrDriverSnapshotDiscovery is the error for when there is an
	// error discovering one or more snapshots.
	ErrDriverSnapshotDiscovery = ErrRexRay(ErrCodeDriverSnapshotDiscovery)

	// ErrMultipleDriversDetected is the error for when there are
	// multiple drivers with the same name detected.
	ErrMultipleDriversDetected = ErrRexRay(ErrCodeMultipleDriversDetected)

	// ErrNoOSDrivers is the error for when there are no registered
	// OS drivers.
	ErrNoOSDrivers = ErrRexRay(ErrCodeNoOSDrivers)

	// ErrNoVolumeDrivers is the error for when there are no registered
	// volume drivers.
	ErrNoVolumeDrivers = ErrRexRay(ErrCodeNoVolumeDrivers)

	// ErrNoStorageDrivers is the error for when there are no registered
	// storage drivers.
	ErrNoStorageDrivers = ErrRexRay(ErrCodeNoStorageDrivers)

	// ErrNotImplemented is the error for when some function is not
	// yet implemented.
	ErrNotImplemented = ErrRexRay(ErrCodeNotImplemented)

	// ErrUnknownOS is the error for when the OS is detected but it
	// is an unknown or unsupported type.
	ErrUnknownOS = ErrRexRay(ErrCodeUnknownOS)

	// ErrUnknownFileSystem is the error for when the filesystem is
	// detected but it is an unknown or unsupported type.
	ErrUnknownFileSystem = ErrRexRay(ErrCodeUnknownFileSystem)

	// ErrMissingVolumeID is the error for when the volume ID is missing.
	ErrMissingVolumeID = ErrRexRay(ErrCodeMissingVolumeID)

	// ErrMultipleVolumesReturned is the error for when only a single
	// volume is expected to be returned but multiple volumes are returned.
	ErrMultipleVolumesReturned = ErrRexRay(ErrCodeMultipleVolumesReturned)

	// ErrNoVolumesReturned is the error for when no volumes are returned.
	ErrNoVolumesReturned = ErrRexRay(ErrCodeNoVolumesReturned)

	// ErrLocalVolumeMaps is the error for when there is an error
	// discovering local volume mappings.
	ErrLocalVolumeMaps = ErrRexRay(ErrCodeLocalVolumeMaps)

	// ErrRunAsyncFromVolume is the error for when an asynchronous
	// create volume is received.
	ErrRunAsyncFromVolume = ErrRexRay(ErrCodeRunAsyncFromVolume)
)

Functions

func New

func New(message string) error

New returns a new error object initialized with the provided message.

func Newf

func Newf(format string, a ...interface{}) error

Newf returns a new error object initialized with the messages created by formatting the format string with the provided arguments.

func WithError

func WithError(message string, inner error) error

WithError returns a new error object initialized with the provided message and inner error.

func WithField

func WithField(key string, val interface{}, message string) error

WithField returns a new error object initialized with the provided field name, value, and error message.

func WithFieldE

func WithFieldE(key string, val interface{}, message string, inner error) error

WithFieldE returns a new error object initialized with the provided field name, value, error message, and inner error.

func WithFields

func WithFields(fields map[string]interface{}, message string) error

WithFields returns a new error object initialized with the provided fields and error message.

func WithFieldsE

func WithFieldsE(fields map[string]interface{}, message string, inner error) error

WithFieldsE returns a new error object initialized with the provided fields, error message, and inner error.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is a structure that implements the Go Error interface as well as the Golf interface for extended log information capabilities.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message.

func (*Error) GolfExportedFields

func (e *Error) GolfExportedFields() map[string]interface{}

GolfExportedFields returns the fields to use when playing golf.

func (*Error) PlayGolf

func (e *Error) PlayGolf() bool

PlayGolf lets the logrus framework know that Error supports the Golf framework.

type Fields

type Fields map[string]interface{}

Fields is a type alias for a map of interfaces.

type RexRayErr

type RexRayErr struct {
	Code RexRayErrCode
}

RexRayErr is the default error type for REX-Ray errors.

func ErrRexRay

func ErrRexRay(code RexRayErrCode) *RexRayErr

ErrRexRay creates a new instance of a RexRayErr with a given error code.

func (*RexRayErr) Error

func (e *RexRayErr) Error() string

Error returns the string version of the error code.

type RexRayErrCode

type RexRayErrCode int

RexRayErrCode is a REX-Ray error code value.

const (
	// ErrCodeUnknown is the error code for an unknown error.
	ErrCodeUnknown RexRayErrCode = iota

	// ErrCodeNoOSDetected is the error code for when no OS is detected.
	ErrCodeNoOSDetected

	// ErrCodeNoVolumesDetected is the error code for when no volumes are
	// detected.
	ErrCodeNoVolumesDetected

	// ErrCodeNoStorageDetected is the error code for when no storage is
	// detected.
	ErrCodeNoStorageDetected

	// ErrCodeDriverBlockDeviceDiscovery is the error code for for when there
	// is an error discovering one or more block devices.
	ErrCodeDriverBlockDeviceDiscovery

	// ErrCodeDriverInstanceDiscovery is the error code for when there is an
	// error discovering an instance.
	ErrCodeDriverInstanceDiscovery

	// ErrCodeDriverVolumeDiscovery is the error code for when there is an
	// error discovering one or more volumes.
	ErrCodeDriverVolumeDiscovery

	// ErrCodeDriverSnapshotDiscovery is the error code for when there is an
	// error discovering one or more snapshots.
	ErrCodeDriverSnapshotDiscovery

	// ErrCodeMultipleDriversDetected is the error code for when there are
	// multiple drivers with the same name detected.
	ErrCodeMultipleDriversDetected

	// ErrCodeNoOSDrivers is the error code for when there are no registered
	// OS drivers.
	ErrCodeNoOSDrivers

	// ErrCodeNoVolumeDrivers is the error code for when there are no
	// registered volume drivers.
	ErrCodeNoVolumeDrivers

	// ErrCodeNoStorageDrivers is the error code for when there are no
	// registered storage drivers.
	ErrCodeNoStorageDrivers

	// ErrCodeNotImplemented is the error code for when some function is not
	// yet implemented.
	ErrCodeNotImplemented

	// ErrCodeUnknownOS is the error code for when the OS is detected but it
	// is an unknown or unsupported type.
	ErrCodeUnknownOS

	// ErrCodeUnknownFileSystem is the error code for when the filesystem is
	// detected but it is an unknown or unsupported type.
	ErrCodeUnknownFileSystem

	// ErrCodeMissingVolumeID is the error code for when the volume ID is
	// missing.
	ErrCodeMissingVolumeID

	// ErrCodeMultipleVolumesReturned is the error code for when only a single
	// volume is expected to be returned but multiple volumes are returned.
	ErrCodeMultipleVolumesReturned

	// ErrCodeNoVolumesReturned is the error code for when no volumes are
	// returned.
	ErrCodeNoVolumesReturned

	// ErrCodeLocalVolumeMaps is the error code for when there is an error
	// discovering local volume mappings.
	ErrCodeLocalVolumeMaps

	// ErrCodeRunAsyncFromVolume is the error code for when an asynchronous
	// create volume is received.
	ErrCodeRunAsyncFromVolume
)

Jump to

Keyboard shortcuts

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