errors

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// ProvisioningStateInconsistent is returned by SetProvisioningState when the provisioning state
	// is inconsistent with the application scale.
	ProvisioningStateInconsistent = errors.ConstError("provisioning state is inconsistent")

	// ErrApplicationShouldNotHaveUnits is returned by SetCharm when the application has units when
	// it is expected to not have units. Used for upgrading from podspec to sidecar charms.
	ErrApplicationShouldNotHaveUnits = errors.ConstError("application should not have units")
)
View Source
const (
	// ErrCannotEnterScope indicates that a relation unit failed to enter its scope
	// due to either the unit or the relation not being Alive.
	ErrCannotEnterScope = errors.ConstError("cannot enter scope")

	// 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 = errors.ConstError("cannot enter scope yet")

	// 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.
	ErrCharmRevisionAlreadyModified = errors.ConstError("charm revision already modified")

	ErrDead = errors.ConstError("not found or dead")

	// IncompatibleBaseError indicates the base selected is not supported by
	// the charm.
	IncompatibleBaseError = errors.ConstError("incompatible base for charm")
)
View Source
const (
	HasAssignedUnitsError = errors.ConstError("has assigned units")

	// HasAttachmentsError indicates that an attempt to destroy
	// a machine failed due to it having storage attachments.
	HasAttachmentsError = errors.ConstError("machine has attachments")

	// HasContainersError indicates that the machine had attempted to be
	// destroyed with containers still running.
	HasContainersError = errors.ConstError("machine is hosting containers")

	// IsControllerMemberError indicates the machine had attempted to be
	// destroyed whilst still considered a controller.
	IsControllerMemberError = errors.ConstError("machine is still a controller member")
)
View Source
const (
	// HasHostedModelsError defines if an attempt was made to destroy the
	// controller model while it contained non-empty hosted models, without
	// specifying that they should also be destroyed.
	HasHostedModelsError = errors.ConstError("has hosted models")

	// ModelNotEmptyError 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.
	ModelNotEmptyError = errors.ConstError("model not empty")

	// PersistentStorageError indicates  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).
	PersistentStorageError = errors.ConstError("model contains persistent storage")
)
View Source
const (
	// 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.ConstError("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.ConstError("unit has storage attachments")
)
View Source
const (
	// StorageAttachedError reports whether or not the given error was caused
	// by an operation on storage that should not be, but is, attached.
	StorageAttachedError = errors.ConstError("storage is attached")
)

Variables

This section is empty.

Functions

func IsDeletedUserError

func IsDeletedUserError(err error) bool

IsDeletedUserError returns true if err is of type deletedUserError.

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 NewDeletedUserError

func NewDeletedUserError(userName string) error

func NewErrIncompatibleBase

func NewErrIncompatibleBase(supportedBases []base.Base, b base.Base, charmName string) error

func NewHasAssignedUnitsError

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

NewHasAssignedUnitsError creates a new error that satisfies HasAssignedUnitsError.

func NewHasAttachmentsError

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

NewHasAttachmentsError creates a new error that satisfies HasAttachmentsError.

func NewHasContainersError

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

NewHasContainersError creates a new error that satisfies HasContainersError.

func NewHasHostedModelsError

func NewHasHostedModelsError(i int) error

func NewIsControllerMemberError

func NewIsControllerMemberError(machineId string, isVoting bool) error

NewIsControllerMemberError creates a new error that satisfies IsControllerMemberError.

func NewModelNotEmptyError

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

NewModelNotEmptyError constructs a ModelNotEmpty with the error message tailored to match the number of machines, applications, volumes and filesystem's left. The returned error satisfies ModelNotEmptyError.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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