This commit is contained in:
Unknwon 2015-11-18 21:21:47 -05:00
parent df339ad8b0
commit f455125d4d
11 changed files with 220 additions and 39 deletions

View file

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