summaryrefslogtreecommitdiff
path: root/api/server/httputils
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2017-02-17 16:47:22 -0800
committerSebastiaan van Stijn <github@gone.nl>2017-02-17 16:51:50 -0800
commit7e44fffe40f39ef4cc0b3bee810f7d0a26136376 (patch)
tree329b004a7263514e17e76aa276e7dad5b3b64105 /api/server/httputils
parentcf5fe9ed0bbadc08512b485f7d1debd423fa3178 (diff)
downloaddocker-7e44fffe40f39ef4cc0b3bee810f7d0a26136376.tar.gz
fix status-code for "locked" swarm and "certificate expired"
These errors were producing the wrong status code, changing to 503. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'api/server/httputils')
-rw-r--r--api/server/httputils/errors.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/server/httputils/errors.go b/api/server/httputils/errors.go
index 8c605f3362..40ff351495 100644
--- a/api/server/httputils/errors.go
+++ b/api/server/httputils/errors.go
@@ -64,6 +64,8 @@ func GetHTTPErrorStatusCode(err error) int {
{"unauthorized", http.StatusUnauthorized},
{"hasn't been activated", http.StatusForbidden},
{"this node", http.StatusServiceUnavailable},
+ {"needs to be unlocked", http.StatusServiceUnavailable},
+ {"certificates have expired", http.StatusServiceUnavailable},
} {
if strings.Contains(errStr, status.keyword) {
statusCode = status.code