errors

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrCannotEnterScope indicates that a relation unit failed to enter its scope
	// due to either the unit or the relation not being Alive.
	ErrCannotEnterScope = stderrors.New("cannot enter scope: unit or relation is not alive")

	// ErrCannotEnterScopeYet indicates that a relation unit failed to enter its
	// scope due to a required and pre-existing subordinate unit that is not Alive.
	// Once that subordinate has been removed, a new one can be created.
	ErrCannotEnterScopeYet = stderrors.New("cannot enter scope yet: non-alive subordinate unit has not been removed")
)
View Source
var (
	// ErrUnitHasSubordinates is a standard error to indicate that a Unit
	// cannot complete an operation to end its life because it still has
	// subordinate applications.
	ErrUnitHasSubordinates = errors.New("unit has subordinates")

	// ErrUnitHasStorageAttachments is a standard error to indicate that
	// a Unit cannot complete an operation to end its life because it still
	// has storage attachments.
	ErrUnitHasStorageAttachments = errors.New("unit has storage attachments")
)
View Source
var ErrCharmRevisionAlreadyModified = fmt.Errorf("charm revision already modified")

ErrCharmRevisionAlreadyModified is returned when a pending or placeholder charm is no longer pending or a placeholder, signaling the charm is available in state with its full information.

View Source
var ErrDead = fmt.Errorf("not found or dead")
View Source
var ErrUpgradeInProgress = errors.New("upgrade in progress")

Functions

func IsCharmAlreadyUploadedError

func IsCharmAlreadyUploadedError(err interface{}) bool

IsCharmAlreadyUploadedError returns if the given error is errCharmAlreadyUploaded.

func IsDeletedUserError

func IsDeletedUserError(err error) bool

IsDeletedUserError returns true if err is of type deletedUserError.

func IsHasAssignedUnitsError

func IsHasAssignedUnitsError(err error) bool

func IsHasAttachmentsError

func IsHasAttachmentsError(err error) bool

IsHasAttachmentsError reports whether or not the error is a hasAttachmentsError, indicating that an attempt to destroy a machine failed due to it having storage attachments.

func IsHasContainersError

func IsHasContainersError(err error) bool

IshasContainersError reports whether or not the error is a hasContainersError, indicating that an attempt to destroy a machine failed due to it having containers.

func IsHasHostedModelsError

func IsHasHostedModelsError(err error) bool

IsHasHostedModelsError reports whether or not the given error was caused by an attempt to destroy the controller model while it contained non-empty hosted models, without specifying that they should also be destroyed.

func IsHasPersistentStorageError

func IsHasPersistentStorageError(err error) bool

IsHasPersistentStorageError reports whether or not the given error was caused by an attempt to destroy a model while it contained persistent storage, without specifying how the storage should be removed (destroyed or released).

func IsIncompatibleSeriesError

func IsIncompatibleSeriesError(err interface{}) bool

IsIncompatibleSeriesError returns if the given error or its cause is errIncompatibleSeries.

func IsModelNotEmptyError

func IsModelNotEmptyError(err error) bool

IsModelNotEmptyError reports whether or not the given error was caused due to an operation requiring a model to be empty, where the model is non-empty.

func IsNeverConnectedError

func IsNeverConnectedError(err error) bool

IsNeverConnectedError returns true if err is of type neverConnectedError.

func IsNeverLoggedInError

func IsNeverLoggedInError(err error) bool

IsNeverLoggedInError returns true if err is of type neverLoggedInError.

func IsNotAlive

func IsNotAlive(err error) bool

IsNotAlive returns true if err is cause by a not alive error.

func IsParentDeviceHasChildrenError

func IsParentDeviceHasChildrenError(err interface{}) bool

IsParentDeviceHasChildrenError returns if the given error or its cause is errParentDeviceHasChildren.

func IsProviderIDNotUniqueError

func IsProviderIDNotUniqueError(err interface{}) bool

IsProviderIDNotUniqueError returns if the given error or its cause is errProviderIDNotUnique.

func IsStorageAttachedError

func IsStorageAttachedError(err error) bool

IsStorageAttachedError reports whether or not the given error was caused by an operation on storage that should not be, but is, attached.

func IsUpgradeInProgressError

func IsUpgradeInProgressError(err error) bool

IsUpgradeInProgressError returns true if the error is caused by an in-progress upgrade.

func IsVersionInconsistentError

func IsVersionInconsistentError(e interface{}) bool

IsVersionInconsistentError returns if the given error is versionInconsistentError.

func NewDeletedUserError

func NewDeletedUserError(userName string) error

func NewErrCharmAlreadyUploaded

func NewErrCharmAlreadyUploaded(curl *charm.URL) error

func NewErrIncompatibleSeries

func NewErrIncompatibleSeries(seriesList []string, series, charmName string) error

func NewHasAssignedUnitsError

func NewHasAssignedUnitsError(machineId string, unitNames []string) error

func NewHasAttachmentsError

func NewHasAttachmentsError(machineId string, attachments []names.Tag) error

func NewHasContainersError

func NewHasContainersError(machineId string, containerIds []string) error

func NewHasHostedModelsError

func NewHasHostedModelsError(i int) error

func NewHasPersistentStorageError

func NewHasPersistentStorageError() error

func NewModelNotEmptyError

func NewModelNotEmptyError(machines, applications, volumes, filesystems int) error

func NewNeverConnectedError

func NewNeverConnectedError(userName string) error

func NewNeverLoggedInError

func NewNeverLoggedInError(userName string) error

func NewNotAliveError

func NewNotAliveError(entity string) error

func NewParentDeviceHasChildrenError

func NewParentDeviceHasChildrenError(parentName string, numChildren int) error

func NewProviderIDNotUniqueError

func NewProviderIDNotUniqueError(providerIDs ...network.Id) error

NewProviderIDNotUniqueError returns an instance of errProviderIDNotUnique initialized with the given duplicate provider IDs.

func NewStorageAttachedError

func NewStorageAttachedError(err string) error

func NewVersionInconsistentError

func NewVersionInconsistentError(currentVersion version.Number, agents []string) *versionInconsistentError

NewVersionInconsistentError returns a new instance of versionInconsistentError.

Types

This section is empty.

Jump to

Keyboard shortcuts

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