Browse code

Merge pull request #31141 from thaJeztah/swarm-node-error-return-503

fix status-code for "locked" swarm and "certificate expired"
(cherry picked from commit 6486924f0b6464a90c9c2d251a3ab0a96302dce9)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2017/02/18 14:10:45
Showing 1 changed files
... ...
@@ -63,6 +63,8 @@ func GetHTTPErrorStatusCode(err error) int {
63 63
 			{"unauthorized", http.StatusUnauthorized},
64 64
 			{"hasn't been activated", http.StatusForbidden},
65 65
 			{"this node", http.StatusServiceUnavailable},
66
+			{"needs to be unlocked", http.StatusServiceUnavailable},
67
+			{"certificates have expired", http.StatusServiceUnavailable},
66 68
 		} {
67 69
 			if strings.Contains(errStr, status.keyword) {
68 70
 				statusCode = status.code