github.com/uriddle/docker@v0.0.0-20210926094723-4072e6aeb013/errors/server.go (about) 1 package errors 2 3 import ( 4 "net/http" 5 6 "github.com/docker/distribution/registry/api/errcode" 7 ) 8 9 var ( 10 // ErrorCodeNewerClientVersion is generated when a request from a client 11 // specifies a higher version than the server supports. 12 ErrorCodeNewerClientVersion = errcode.Register(errGroup, errcode.ErrorDescriptor{ 13 Value: "NEWERCLIENTVERSION", 14 Message: "client is newer than server (client API version: %s, server API version: %s)", 15 Description: "The client version is higher than the server version", 16 HTTPStatusCode: http.StatusBadRequest, 17 }) 18 19 // ErrorCodeOldClientVersion is generated when a request from a client 20 // specifies a version lower than the minimum version supported by the server. 21 ErrorCodeOldClientVersion = errcode.Register(errGroup, errcode.ErrorDescriptor{ 22 Value: "OLDCLIENTVERSION", 23 Message: "client version %s is too old. Minimum supported API version is %s, please upgrade your client to a newer version", 24 Description: "The client version is too old for the server", 25 HTTPStatusCode: http.StatusBadRequest, 26 }) 27 28 // ErrorNetworkControllerNotEnabled is generated when the networking stack in not enabled 29 // for certain platforms, like windows. 30 ErrorNetworkControllerNotEnabled = errcode.Register(errGroup, errcode.ErrorDescriptor{ 31 Value: "NETWORK_CONTROLLER_NOT_ENABLED", 32 Message: "the network controller is not enabled for this platform", 33 Description: "Docker's networking stack is disabled for this platform", 34 HTTPStatusCode: http.StatusNotFound, 35 }) 36 37 // ErrorCodeNoHijackConnection is generated when a request tries to attach to a container 38 // but the connection to hijack is not provided. 39 ErrorCodeNoHijackConnection = errcode.Register(errGroup, errcode.ErrorDescriptor{ 40 Value: "HIJACK_CONNECTION_MISSING", 41 Message: "error attaching to container %s, hijack connection missing", 42 Description: "The caller didn't provide a connection to hijack", 43 HTTPStatusCode: http.StatusBadRequest, 44 }) 45 )