Browse code

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>

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