浏览代码

Merge pull request #14332 from ankushagarwal/failedLogin

Add 500 check for registry api call
David Calavera 10 年之前
父节点
当前提交
46aea60fb0
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      registry/auth.go

+ 3 - 0
registry/auth.go

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