From 7e44fffe40f39ef4cc0b3bee810f7d0a26136376 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 17 Feb 2017 16:47:22 -0800 Subject: [PATCH] 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 --- api/server/httputils/errors.go | 2 ++ 1 file changed, 2 insertions(+) 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