make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945)

This commit is contained in:
Lanre Adelowo authored and Lauris BH committed 2018-09-16 18:27:43 +03:00
1 parent f6eb669b51
commit acb6f8a518
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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()