瀏覽代碼

#1971 more general rule to detect error

Unknwon 9 年之前
父節點
當前提交
c0b0ce7b1a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      routers/repo/repo.go

+ 2 - 2
routers/repo/repo.go

@@ -203,9 +203,9 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
 		}
 	}
 
-	if strings.Contains(err.Error(), "Authentication failed") ||
-		strings.Contains(err.Error(), " not found") ||
+	if strings.Contains(err.Error(), "fatal:") ||
 		strings.Contains(err.Error(), "could not read Username") {
+		ctx.Data["Err_CloneAddr"] = true
 		ctx.Data["Err_Auth"] = true
 		ctx.RenderWithErr(ctx.Tr("form.auth_failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
 		return