1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

fix status-code for "locked" swarm and "certificate expired"
This commit is contained in:
Sebastiaan van Stijn 2017-02-17 21:10:45 -08:00 committed by GitHub
commit 6486924f0b

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