1
0
Fork 0
forked from forgejo/forgejo

Handle expected errors in AddGPGkey API (#11644)

* handle GPG Parse & Email Errors

* correct TEST

* update Swagger

* more Docu
This commit is contained in:
6543 2020-05-28 23:25:54 +02:00 committed by GitHub
parent 9f55769804
commit 560744fb33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 4 deletions

View file

@ -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
}