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>
This commit is contained in:
Sebastiaan van Stijn 2017-02-17 16:47:22 -08:00
parent cf5fe9ed0b
commit 7e44fffe40
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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