aboutsummaryrefslogtreecommitdiffstats
path: root/models/ssh_key.go
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2018-09-16 16:27:43 +0100
committerLauris BH <lauris@nix.lv>2018-09-16 18:27:43 +0300
commitacb6f8a518678278368f76d42e6d0763a21e6e9b (patch)
tree579205ca40b79585a1dd9435e80025902d0f59d1 /models/ssh_key.go
parentf6eb669b519f8a1a323ca7ae668cde3b6e257bf0 (diff)
downloadgitea-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 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go
index 9c839755c8..c2836e6885 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -732,7 +732,7 @@ func AddDeployKey(repoID int64, name, content string, readOnly bool) (*DeployKey
key, err := addDeployKey(sess, pkey.ID, repoID, name, pkey.Fingerprint, accessMode)
if err != nil {
- return nil, fmt.Errorf("addDeployKey: %v", err)
+ return nil, err
}
return key, sess.Commit()