summaryrefslogtreecommitdiffstats
path: root/models/gpg_key.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-05-28 23:25:54 +0200
committerGitHub <noreply@github.com>2020-05-28 17:25:54 -0400
commit560744fb3399b33b8006e5a6a54a473696cc5b34 (patch)
tree6cfb6b38c72f711069106591f07dae006cab6aa7 /models/gpg_key.go
parent9f5576980411385a21668ce5930e53b89be67a5e (diff)
downloadgitea-560744fb3399b33b8006e5a6a54a473696cc5b34.tar.gz
gitea-560744fb3399b33b8006e5a6a54a473696cc5b34.zip
Handle expected errors in AddGPGkey API (#11644)
* handle GPG Parse & Email Errors * correct TEST * update Swagger * more Docu
Diffstat (limited to 'models/gpg_key.go')
-rw-r--r--models/gpg_key.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index a32312a12d..bebd33191a 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -273,7 +273,7 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
for i, k := range e.Subkeys {
subs, err := parseSubGPGKey(ownerID, pubkey.KeyIdString(), k.PublicKey, expiry)
if err != nil {
- return nil, err
+ return nil, ErrGPGKeyParsing{ParseError: err}
}
subkeys[i] = subs
}