diff options
author | Unknwon <u@gogs.io> | 2015-11-19 13:45:07 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-19 13:45:07 -0500 |
commit | 6a66e5fc98892f0ac7ee388b7a05e099cf29688f (patch) | |
tree | 4ba1f0ac807dd4679710cd50b424dcd23945a730 /routers/repo/repo.go | |
parent | c0b0ce7b1a0cd3d5001507ad0a7258d9d2345401 (diff) | |
download | gitea-6a66e5fc98892f0ac7ee388b7a05e099cf29688f.tar.gz gitea-6a66e5fc98892f0ac7ee388b7a05e099cf29688f.zip |
better error message
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r-- | routers/repo/repo.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index d084faa4ea..f930c132d2 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -203,12 +203,15 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - if strings.Contains(err.Error(), "fatal:") || + if strings.Contains(err.Error(), "Authentication failed") || 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 + } else if strings.Contains(err.Error(), "fatal:") { + ctx.Data["Err_CloneAddr"] = true + ctx.RenderWithErr(ctx.Tr("repo.migrate.failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form) + return } handleCreateError(ctx, err, "MigratePost", MIGRATE, &form) |