Browse code

Add 500 check for registry api call

Partially Addresses #14326

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>

Ankush Agarwal authored on 2015/07/02 05:02:55
Showing 1 changed files
... ...
@@ -180,6 +180,9 @@ func loginV1(authConfig *cliconfig.AuthConfig, registryEndpoint *Endpoint) (stri
180 180
 				}
181 181
 				// *TODO: Use registry configuration to determine what this says, if anything?
182 182
 				return "", fmt.Errorf("Login: Account is not Active. Please see the documentation of the registry %s for instructions how to activate it.", serverAddress)
183
+			} else if resp.StatusCode == 500 { // Issue #14326
184
+				logrus.Errorf("%s returned status code %d. Response Body :\n%s", req.URL.String(), resp.StatusCode, body)
185
+				return "", fmt.Errorf("Internal Server Error")
183 186
 			}
184 187
 			return "", fmt.Errorf("Login: %s (Code: %d; Headers: %s)", body, resp.StatusCode, resp.Header)
185 188
 		}