diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-09-16 16:27:43 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-09-16 18:27:43 +0300 |
commit | acb6f8a518678278368f76d42e6d0763a21e6e9b (patch) | |
tree | 579205ca40b79585a1dd9435e80025902d0f59d1 /routers | |
parent | f6eb669b519f8a1a323ca7ae668cde3b6e257bf0 (diff) | |
download | gitea-acb6f8a518678278368f76d42e6d0763a21e6e9b.tar.gz gitea-acb6f8a518678278368f76d42e6d0763a21e6e9b.zip |
make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/setting.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index dc558ff209..ff6b07f8e0 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -586,7 +586,7 @@ func DeployKeysPost(ctx *context.Context, form auth.AddKeyForm) { if err != nil { ctx.Data["HasError"] = true switch { - case models.IsErrKeyAlreadyExist(err): + case models.IsErrDeployKeyAlreadyExist(err): ctx.Data["Err_Content"] = true ctx.RenderWithErr(ctx.Tr("repo.settings.key_been_used"), tplDeployKeys, &form) case models.IsErrKeyNameAlreadyUsed(err): |