diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-04-14 18:43:56 +0200 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-14 12:43:56 -0400 |
commit | d699de32f2f6fd2216c8d620c8f53011e511b56b (patch) | |
tree | 1588178184132c2ac6f84af763ba003c469dba4c /models/error.go | |
parent | 38889f09cbe039217f159838961b631f8f8d3b46 (diff) | |
download | gitea-d699de32f2f6fd2216c8d620c8f53011e511b56b.tar.gz gitea-d699de32f2f6fd2216c8d620c8f53011e511b56b.zip |
add .gpg url (match github behaviour) (#6610)
* add .gpg url (match github behaviour)
* wildcard
* test to export maximum data
* working POC
* add comment for old imported keys
* cleaning
* Update routers/user/profile.go
Co-Authored-By: sapk <sapk@users.noreply.github.com>
* add migration script
* add integration tests
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 6a135bda1a..f079af4e1f 100644 --- a/models/error.go +++ b/models/error.go @@ -379,6 +379,21 @@ func (err ErrGPGKeyNotExist) Error() string { return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID) } +// ErrGPGKeyImportNotExist represents a "GPGKeyImportNotExist" kind of error. +type ErrGPGKeyImportNotExist struct { + ID string +} + +// IsErrGPGKeyImportNotExist checks if an error is a ErrGPGKeyImportNotExist. +func IsErrGPGKeyImportNotExist(err error) bool { + _, ok := err.(ErrGPGKeyImportNotExist) + return ok +} + +func (err ErrGPGKeyImportNotExist) Error() string { + return fmt.Sprintf("public gpg key import does not exist [id: %s]", err.ID) +} + // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error. type ErrGPGKeyIDAlreadyUsed struct { KeyID string |