juju: github.com/juju/juju/apiserver/errors Index | Files

package errors

import "github.com/juju/juju/apiserver/errors"

Index

Package Files

errors.go

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")
)

func DestroyErr Uses

func DestroyErr(desc string, ids []string, errs []error) error

func IsDischargeRequiredError Uses

func IsDischargeRequiredError(err error) bool

IsDischargeRequiredError reports whether the cause of the error is a *DischargeRequiredError.

func IsRedirectError Uses

func IsRedirectError(err error) bool

IsRedirectError returns true if err is caused by a RedirectError.

func IsUpgradeInProgressError Uses

func IsUpgradeInProgressError(err error) bool

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

func IsUpgradeSeriesValidationError Uses

func IsUpgradeSeriesValidationError(err error) bool

IsUpgradeSeriesValidationError returns true if this error is caused by a upgrade-series validation error.

func NoAddressSetError Uses

func NoAddressSetError(unitTag names.UnitTag, addressName string) error

func NotSupportedError Uses

func NotSupportedError(tag names.Tag, operation string) error

func OperationBlockedError Uses

func OperationBlockedError(msg string) error

OperationBlockedError returns an error which signifies that an operation has been blocked; the message should describe what has been blocked.

func RestoreError Uses

func RestoreError(err error) error

RestoreError makes a best effort at converting the given error back into an error originally converted by ServerError().

func ServerError Uses

func ServerError(err error) *params.Error

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 Uses

func ServerErrorAndStatus(err error) (*params.Error, int)

ServerErrorAndStatus is like ServerError but also returns an HTTP status code appropriate for using in a response holding the given error.

func UnknownModelError Uses

func UnknownModelError(uuid string) error

type DischargeRequiredError Uses

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 Uses

func (e *DischargeRequiredError) Error() string

Error implements the error interface.

type RedirectError Uses

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 Uses

func (e *RedirectError) Error() string

Error implements the error interface.

type UpgradeSeriesValidationError Uses

type UpgradeSeriesValidationError struct {
    Cause  error
    Status string
}

UpgradeSeriesValidationError is the error returns when a upgrade-series can not be run because of a validation error.

func (*UpgradeSeriesValidationError) Error Uses

func (e *UpgradeSeriesValidationError) Error() string

Error implements the error interface.

Package errors imports 14 packages (graph) and is imported by 121 packages. Updated 2020-09-27. Refresh now. Tools for package owners.