This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathserver.go
36 lines (31 loc) · 1.53 KB
/
server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package errors
import (
"net/http"
"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",
Message: "the network controller is not enabled for this platform",
Description: "Docker's networking stack is disabled for this platform",
HTTPStatusCode: http.StatusNotFound,
})
)