diff options
author | Unknwon <u@gogs.io> | 2015-11-18 21:21:47 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-18 21:21:47 -0500 |
commit | f455125d4de8c788143a24edefb8c6b2cef0f524 (patch) | |
tree | b6a258d73a3e25362fd0005b2954ebe84869fede /models/error.go | |
parent | df339ad8b0c4f8858a53a4890ded97a1e3208b13 (diff) | |
download | gitea-f455125d4de8c788143a24edefb8c6b2cef0f524.tar.gz gitea-f455125d4de8c788143a24edefb8c6b2cef0f524.zip |
fix #878
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index f8fea6f560..7693e14edb 100644 --- a/models/error.go +++ b/models/error.go @@ -114,6 +114,19 @@ func (err ErrUserHasOrgs) Error() string { // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____| // \/ \/ \/ \/\/ +type ErrKeyUnableVerify struct { + Result string +} + +func IsErrKeyUnableVerify(err error) bool { + _, ok := err.(ErrKeyUnableVerify) + return ok +} + +func (err ErrKeyUnableVerify) Error() string { + return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result) +} + type ErrKeyNotExist struct { ID int64 } @@ -155,6 +168,21 @@ func (err ErrKeyNameAlreadyUsed) Error() string { return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name) } +type ErrDeployKeyNotExist struct { + ID int64 + KeyID int64 + RepoID int64 +} + +func IsErrDeployKeyNotExist(err error) bool { + _, ok := err.(ErrDeployKeyNotExist) + return ok +} + +func (err ErrDeployKeyNotExist) Error() string { + return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID) +} + type ErrDeployKeyAlreadyExist struct { KeyID int64 RepoID int64 |