Exemple #1
0
package errors

// This file contains all of the errors that can be generated from the
// docker/image component.

import (
	"net/http"

	"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/distribution/registry/api/errcode"
)

var (
	// ErrorCodeInvalidImageID is generated when image id specified is incorrectly formatted.
	ErrorCodeInvalidImageID = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "INVALIDIMAGEID",
		Message:        "image ID '%s' is invalid ",
		Description:    "The specified image id is incorrectly formatted",
		HTTPStatusCode: http.StatusInternalServerError,
	})
)
Exemple #2
0
package errors

import (
	"net/http"

	"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/distribution/registry/api/errcode"
)

var (
	// ErrorCodeNewerClientVersion is generated when a request from a client
	// specifies a higher version than the server supports.
	ErrorCodeNewerClientVersion = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "NEWERCLIENTVERSION",
		Message:        "client is newer than server (client API version: %s, server API version: %s)",
		Description:    "The client version is higher than the server version",
		HTTPStatusCode: http.StatusBadRequest,
	})

	// ErrorCodeOldClientVersion is generated when a request from a client
	// specifies a version lower than the minimum version supported by the server.
	ErrorCodeOldClientVersion = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "OLDCLIENTVERSION",
		Message:        "client version %s is too old. Minimum supported API version is %s, please upgrade your client to a newer version",
		Description:    "The client version is too old for the server",
		HTTPStatusCode: http.StatusBadRequest,
	})

	// ErrorNetworkControllerNotEnabled is generated when the networking stack in not enabled
	// for certain platforms, like windows.
	ErrorNetworkControllerNotEnabled = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "NETWORK_CONTROLLER_NOT_ENABLED",
Exemple #3
0
// This file contains all of the errors that can be generated from the
// docker/builder component.

import (
	"net/http"

	"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/distribution/registry/api/errcode"
)

var (
	// ErrorCodeAtLeastOneArg is generated when the parser comes across a
	// Dockerfile command that doesn't have any args.
	ErrorCodeAtLeastOneArg = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "ATLEASTONEARG",
		Message:        "%s requires at least one argument",
		Description:    "The specified command requires at least one argument",
		HTTPStatusCode: http.StatusInternalServerError,
	})

	// ErrorCodeExactlyOneArg is generated when the parser comes across a
	// Dockerfile command that requires exactly one arg but got less/more.
	ErrorCodeExactlyOneArg = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "EXACTLYONEARG",
		Message:        "%s requires exactly one argument",
		Description:    "The specified command requires exactly one argument",
		HTTPStatusCode: http.StatusInternalServerError,
	})

	// ErrorCodeAtLeastTwoArgs is generated when the parser comes across a
	// Dockerfile command that requires at least two args but got less.
	ErrorCodeAtLeastTwoArgs = errcode.Register(errGroup, errcode.ErrorDescriptor{
Exemple #4
0
package v2

import (
	"net/http"

	"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/distribution/registry/api/errcode"
)

const errGroup = "registry.api.v2"

var (
	// ErrorCodeUnsupported is returned when an operation is not supported.
	ErrorCodeUnsupported = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:   "UNSUPPORTED",
		Message: "The operation is unsupported.",
		Description: `The operation was unsupported due to a missing
		implementation or invalid set of parameters.`,
	})

	// ErrorCodeUnauthorized is returned if a request is not authorized.
	ErrorCodeUnauthorized = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:   "UNAUTHORIZED",
		Message: "access to the requested resource is not authorized",
		Description: `The access controller denied access for the operation on
		a resource. Often this will be accompanied by a 401 Unauthorized
		response status.`,
		HTTPStatusCode: http.StatusUnauthorized,
	})

	// ErrorCodeDigestInvalid is returned when uploading a blob if the
	// provided digest does not match the blob contents.
Exemple #5
0
// This file contains all of the errors that can be generated from the
// docker/daemon component.

import (
	"net/http"

	"github.com/flynn/flynn/Godeps/_workspace/src/github.com/docker/distribution/registry/api/errcode"
)

var (
	// ErrorCodeNoSuchContainer is generated when we look for a container by
	// name or ID and we can't find it.
	ErrorCodeNoSuchContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "NOSUCHCONTAINER",
		Message:        "no such id: %s",
		Description:    "The specified container can not be found",
		HTTPStatusCode: http.StatusNotFound,
	})

	// ErrorCodeUnregisteredContainer is generated when we try to load
	// a storage driver for an unregistered container
	ErrorCodeUnregisteredContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:          "UNREGISTEREDCONTAINER",
		Message:        "Can't load storage driver for unregistered container %s",
		Description:    "An attempt was made to load the storage driver for a container that is not registered with the daemon",
		HTTPStatusCode: http.StatusInternalServerError,
	})

	// ErrorCodeContainerBeingRemoved is generated when an attempt to start
	// a container is made but its in the process of being removed, or is dead.
	ErrorCodeContainerBeingRemoved = errcode.Register(errGroup, errcode.ErrorDescriptor{