docker: github.com/docker/docker/errdefs Index | Files

package errdefs

import "github.com/docker/docker/errdefs"

Package errdefs defines a set of error interfaces that packages should use for communicating classes of errors. Errors that cross the package boundary should implement one (and only one) of these interfaces.

Packages should not reference these interfaces directly, only implement them. To check if a particular error implements one of these interfaces, there are helper functions provided (e.g. `Is<SomeError>`) which can be used rather than asserting the interfaces directly. If you must assert on these interfaces, be sure to check the causal chain (`err.Cause()`).

Index

Package Files

defs.go doc.go helpers.go http_helpers.go is.go

func Cancelled Uses

func Cancelled(err error) error

Cancelled is a helper to create an error of the class with the same name from any error type

func Conflict Uses

func Conflict(err error) error

Conflict is a helper to create an error of the class with the same name from any error type

func DataLoss Uses

func DataLoss(err error) error

DataLoss is a helper to create an error of the class with the same name from any error type

func Deadline Uses

func Deadline(err error) error

Deadline is a helper to create an error of the class with the same name from any error type

func Forbidden Uses

func Forbidden(err error) error

Forbidden is a helper to create an error of the class with the same name from any error type

func FromContext Uses

func FromContext(ctx context.Context) error

FromContext returns the error class from the passed in context

func FromStatusCode Uses

func FromStatusCode(err error, statusCode int) error

FromStatusCode creates an errdef error, based on the provided HTTP status-code

func GetHTTPErrorStatusCode Uses

func GetHTTPErrorStatusCode(err error) int

GetHTTPErrorStatusCode retrieves status code from error message.

func InvalidParameter Uses

func InvalidParameter(err error) error

InvalidParameter is a helper to create an error of the class with the same name from any error type

func IsCancelled Uses

func IsCancelled(err error) bool

IsCancelled returns if the passed in error is an ErrCancelled

func IsConflict Uses

func IsConflict(err error) bool

IsConflict returns if the passed in error is an ErrConflict

func IsDataLoss Uses

func IsDataLoss(err error) bool

IsDataLoss returns if the passed in error is an ErrDataLoss

func IsDeadline Uses

func IsDeadline(err error) bool

IsDeadline returns if the passed in error is an ErrDeadline

func IsForbidden Uses

func IsForbidden(err error) bool

IsForbidden returns if the passed in error is an ErrForbidden

func IsInvalidParameter Uses

func IsInvalidParameter(err error) bool

IsInvalidParameter returns if the passed in error is an ErrInvalidParameter

func IsNotFound Uses

func IsNotFound(err error) bool

IsNotFound returns if the passed in error is an ErrNotFound

func IsNotImplemented Uses

func IsNotImplemented(err error) bool

IsNotImplemented returns if the passed in error is an ErrNotImplemented

func IsNotModified Uses

func IsNotModified(err error) bool

IsNotModified returns if the passed in error is a NotModified error

func IsSystem Uses

func IsSystem(err error) bool

IsSystem returns if the passed in error is an ErrSystem

func IsUnauthorized Uses

func IsUnauthorized(err error) bool

IsUnauthorized returns if the passed in error is an ErrUnauthorized

func IsUnavailable Uses

func IsUnavailable(err error) bool

IsUnavailable returns if the passed in error is an ErrUnavailable

func IsUnknown Uses

func IsUnknown(err error) bool

IsUnknown returns if the passed in error is an ErrUnknown

func NotFound Uses

func NotFound(err error) error

NotFound is a helper to create an error of the class with the same name from any error type

func NotImplemented Uses

func NotImplemented(err error) error

NotImplemented is a helper to create an error of the class with the same name from any error type

func NotModified Uses

func NotModified(err error) error

NotModified is a helper to create an error of the class with the same name from any error type

func System Uses

func System(err error) error

System is a helper to create an error of the class with the same name from any error type

func Unauthorized Uses

func Unauthorized(err error) error

Unauthorized is a helper to create an error of the class with the same name from any error type

func Unavailable Uses

func Unavailable(err error) error

Unavailable is a helper to create an error of the class with the same name from any error type

func Unknown Uses

func Unknown(err error) error

Unknown is a helper to create an error of the class with the same name from any error type

type ErrCancelled Uses

type ErrCancelled interface {
    Cancelled()
}

ErrCancelled signals that the action was cancelled.

type ErrConflict Uses

type ErrConflict interface {
    Conflict()
}

ErrConflict signals that some internal state conflicts with the requested action and can't be performed. A change in state should be able to clear this error.

type ErrDataLoss Uses

type ErrDataLoss interface {
    DataLoss()
}

ErrDataLoss indicates that data was lost or there is data corruption.

type ErrDeadline Uses

type ErrDeadline interface {
    DeadlineExceeded()
}

ErrDeadline signals that the deadline was reached before the action completed.

type ErrForbidden Uses

type ErrForbidden interface {
    Forbidden()
}

ErrForbidden signals that the requested action cannot be performed under any circumstances. When a ErrForbidden is returned, the caller should never retry the action.

type ErrInvalidParameter Uses

type ErrInvalidParameter interface {
    InvalidParameter()
}

ErrInvalidParameter signals that the user input is invalid

type ErrNotFound Uses

type ErrNotFound interface {
    NotFound()
}

ErrNotFound signals that the requested object doesn't exist

type ErrNotImplemented Uses

type ErrNotImplemented interface {
    NotImplemented()
}

ErrNotImplemented signals that the requested action/feature is not implemented on the system as configured.

type ErrNotModified Uses

type ErrNotModified interface {
    NotModified()
}

ErrNotModified signals that an action can't be performed because it's already in the desired state

type ErrSystem Uses

type ErrSystem interface {
    System()
}

ErrSystem signals that some internal error occurred. An example of this would be a failed mount request.

type ErrUnauthorized Uses

type ErrUnauthorized interface {
    Unauthorized()
}

ErrUnauthorized is used to signify that the user is not authorized to perform a specific action

type ErrUnavailable Uses

type ErrUnavailable interface {
    Unavailable()
}

ErrUnavailable signals that the requested action/subsystem is not available.

type ErrUnknown Uses

type ErrUnknown interface {
    Unknown()
}

ErrUnknown signals that the kind of error that occurred is not known.

Package errdefs imports 8 packages (graph) and is imported by 175 packages. Updated 2020-11-28. Refresh now. Tools for package owners.