Documentation ¶
Index ¶
- Variables
- func DestroyErr(desc string, ids []string, errs []error) error
- func IsDeadlineExceededError(err error) bool
- func IsDischargeRequiredError(err error) bool
- func IsIncompatibleSeriesError(err interface{}) bool
- func IsNotLeaderError(err error) bool
- func IsRedirectError(err error) bool
- func IsUpgradeInProgressError(err error) bool
- func IsUpgradeSeriesValidationError(err error) bool
- func NewDeadlineExceededError(message string) error
- func NewErrIncompatibleSeries(seriesList []string, series, charmName string) error
- func NewNotLeaderError(serverAddress, serverID string) error
- func NoAddressSetError(unitTag names.UnitTag, addressName string) error
- func NotSupportedError(tag names.Tag, operation string) error
- func OperationBlockedError(msg string) error
- func RestoreError(err error) error
- func ServerError(err error) *params.Error
- func ServerErrorAndStatus(err error) (*params.Error, int)
- func UnknownModelError(uuid string) error
- type DeadlineExceededError
- type DischargeRequiredError
- type NotLeaderError
- type RedirectError
- type UpgradeSeriesValidationError
Constants ¶
This section is empty.
Variables ¶
var ( ErrBadId = errors.New("id not found") ErrBadCreds = errors.New("invalid entity name or password") ErrNoCreds = errors.New("no credentials provided") ErrLoginExpired = errors.New("login expired") ErrPerm = errors.New("permission denied") ErrNotLoggedIn = errors.New("not logged in") ErrUnknownWatcher = errors.New("unknown watcher id") ErrStoppedWatcher = errors.New("watcher has been stopped") ErrBadRequest = errors.New("invalid request") ErrTryAgain = errors.New("try again") ErrActionNotAvailable = errors.New("action no longer available") )
Functions ¶
func IsDeadlineExceededError ¶
IsDeadlineExceededError returns true if the error is the DeadlineExceededError.
func IsDischargeRequiredError ¶
IsDischargeRequiredError reports whether the cause of the error is a *DischargeRequiredError.
func IsIncompatibleSeriesError ¶
func IsIncompatibleSeriesError(err interface{}) bool
IsIncompatibleSeriesError returns if the given error or its cause is errIncompatibleSeries.
func IsNotLeaderError ¶
IsNotLeaderError returns true if the error is the NotLeaderError.
func IsRedirectError ¶
IsRedirectError returns true if err is caused by a RedirectError.
func IsUpgradeInProgressError ¶
IsUpgradeInProgressError returns true if this error is caused by an upgrade in progress.
func IsUpgradeSeriesValidationError ¶
IsUpgradeSeriesValidationError returns true if this error is caused by a upgrade-series validation error.
func NewDeadlineExceededError ¶
NewDeadlineExceededError creates a new DeadlineExceededError with the underlying message.
func NewNotLeaderError ¶
NewNotLeaderError creates a new NotLeaderError with the server address and/or server ID of the current raft state leader.
func NoAddressSetError ¶
func NotSupportedError ¶
func OperationBlockedError ¶
OperationBlockedError returns an error which signifies that an operation has been blocked; the message should describe what has been blocked.
func RestoreError ¶
RestoreError makes a best effort at converting the given error back into an error originally converted by ServerError().
func ServerError ¶
ServerError returns an error suitable for returning to an API client, with an error code suitable for various kinds of errors generated in packages outside the API.
func ServerErrorAndStatus ¶
ServerErrorAndStatus is like ServerError but also returns an HTTP status code appropriate for using in a response holding the given error.
func UnknownModelError ¶
Types ¶
type DeadlineExceededError ¶
type DeadlineExceededError struct {
// contains filtered or unexported fields
}
DeadlineExceededError creates a typed error for when a raft operation is enqueued, but the deadline is exceeded.
func (*DeadlineExceededError) Error ¶
func (e *DeadlineExceededError) Error() string
type DischargeRequiredError ¶
type DischargeRequiredError struct { Cause error LegacyMacaroon *macaroon.Macaroon Macaroon *bakery.Macaroon }
DischargeRequiredError is the error returned when a macaroon requires discharging to complete authentication.
func (*DischargeRequiredError) Error ¶
func (e *DischargeRequiredError) Error() string
Error implements the error interface.
type NotLeaderError ¶
type NotLeaderError struct {
// contains filtered or unexported fields
}
NotLeaderError creates a typed error for when a raft operation is applied, but the raft state shows that it's not the leader. The error will help redirect the consumer of the error to workout where they can try and find the leader.
func (*NotLeaderError) AsMap ¶
func (e *NotLeaderError) AsMap() map[string]interface{}
AsMap returns a map of the error. Useful when crossing the facade boundary and wanting information in the client.
func (*NotLeaderError) Error ¶
func (e *NotLeaderError) Error() string
func (*NotLeaderError) ServerAddress ¶
func (e *NotLeaderError) ServerAddress() string
ServerAddress returns the address of the potential current leader. It's not guaranteed to be the leader, as things may of changed when attempting the same request on the new leader.
func (*NotLeaderError) ServerID ¶
func (e *NotLeaderError) ServerID() string
ServerID returns the server ID from the raft state. This should align with the controller machine ID of Juju.
type RedirectError ¶
type RedirectError struct { // Servers holds the sets of addresses of the redirected servers. // TODO (manadart 2019-11-08): Change this to be either MachineHostPorts // or the HostPorts indirection. We don't care about space info here. // We can then delete the API params helpers for conversion for this type // as it will no longer be used. Servers []network.ProviderHostPorts `json:"servers"` // CACert holds the certificate of the remote server. CACert string `json:"ca-cert"` // ControllerTag uniquely identifies the controller being redirected to. ControllerTag names.ControllerTag `json:"controller-tag,omitempty"` // An optional alias for the controller where the model got redirected to. ControllerAlias string `json:"controller-alias,omitempty"` }
RedirectError is the error returned when a model (previously accessible by the user) has been migrated to a different controller.
func (*RedirectError) Error ¶
func (e *RedirectError) Error() string
Error implements the error interface.
type UpgradeSeriesValidationError ¶
UpgradeSeriesValidationError is the error returns when a upgrade-series can not be run because of a validation error.
func (*UpgradeSeriesValidationError) Error ¶
func (e *UpgradeSeriesValidationError) Error() string
Error implements the error interface.