Improve error feedback for duplicate deploy keys (#13112)

Instead of a generic HTTP 500 error page, a flash message is rendered with the deploy key page template to inform the user that a key with the intended title already exists. 

Fixes #13110
This commit is contained in:
Chris Shyi authored and GitHub committed 2020-10-12 14:44:56 +01:00
1 parent 0e4f663126
commit c752ccee64
3 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -547,7 +547,7 @@ func IsErrDeployKeyNameAlreadyUsed(err error) bool {
}
func (err ErrDeployKeyNameAlreadyUsed) Error() string {
return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
return fmt.Sprintf("public key with name already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
}
// _____ ___________ __