|
@@ -10,6 +10,7 @@ import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+// ErrNameReserved represents a "reserved name" error.
|
|
|
type ErrNameReserved struct {
|
|
type ErrNameReserved struct {
|
|
|
Name string
|
|
Name string
|
|
|
}
|
|
}
|
|
@@ -24,6 +25,7 @@ func (err ErrNameReserved) Error() string {
|
|
|
return fmt.Sprintf("name is reserved [name: %s]", err.Name)
|
|
return fmt.Sprintf("name is reserved [name: %s]", err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrNamePatternNotAllowed represents a "pattern not allowed" error.
|
|
|
type ErrNamePatternNotAllowed struct {
|
|
type ErrNamePatternNotAllowed struct {
|
|
|
Pattern string
|
|
Pattern string
|
|
|
}
|
|
}
|
|
@@ -39,6 +41,7 @@ func (err ErrNamePatternNotAllowed) Error() string {
|
|
|
return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
|
|
return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrUserAlreadyExist represents a "user already exists" error.
|
|
|
type ErrUserAlreadyExist struct {
|
|
type ErrUserAlreadyExist struct {
|
|
|
Name string
|
|
Name string
|
|
|
}
|
|
}
|
|
@@ -53,6 +56,7 @@ func (err ErrUserAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("user already exists [name: %s]", err.Name)
|
|
return fmt.Sprintf("user already exists [name: %s]", err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
|
|
|
type ErrEmailAlreadyUsed struct {
|
|
type ErrEmailAlreadyUsed struct {
|
|
|
Email string
|
|
Email string
|
|
|
}
|
|
}
|
|
@@ -67,6 +71,7 @@ func (err ErrEmailAlreadyUsed) Error() string {
|
|
|
return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
|
|
return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
|
|
|
type ErrUserOwnRepos struct {
|
|
type ErrUserOwnRepos struct {
|
|
|
UID int64
|
|
UID int64
|
|
|
}
|
|
}
|
|
@@ -81,6 +86,7 @@ func (err ErrUserOwnRepos) Error() string {
|
|
|
return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
|
|
return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
|
|
|
type ErrUserHasOrgs struct {
|
|
type ErrUserHasOrgs struct {
|
|
|
UID int64
|
|
UID int64
|
|
|
}
|
|
}
|
|
@@ -95,6 +101,7 @@ func (err ErrUserHasOrgs) Error() string {
|
|
|
return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
|
|
return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
|
|
|
type ErrWikiAlreadyExist struct {
|
|
type ErrWikiAlreadyExist struct {
|
|
|
Title string
|
|
Title string
|
|
|
}
|
|
}
|
|
@@ -109,6 +116,7 @@ func (err ErrWikiAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
|
|
return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
|
|
|
type ErrKeyUnableVerify struct {
|
|
type ErrKeyUnableVerify struct {
|
|
|
Result string
|
|
Result string
|
|
|
}
|
|
}
|
|
@@ -123,6 +131,7 @@ func (err ErrKeyUnableVerify) Error() string {
|
|
|
return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
|
|
return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrKeyNotExist represents a "KeyNotExist" kind of error.
|
|
|
type ErrKeyNotExist struct {
|
|
type ErrKeyNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
}
|
|
}
|
|
@@ -137,6 +146,7 @@ func (err ErrKeyNotExist) Error() string {
|
|
|
return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
|
|
return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
|
|
|
type ErrKeyAlreadyExist struct {
|
|
type ErrKeyAlreadyExist struct {
|
|
|
OwnerID int64
|
|
OwnerID int64
|
|
|
Content string
|
|
Content string
|
|
@@ -152,6 +162,7 @@ func (err ErrKeyAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("public key already exists [owner_id: %d, content: %s]", err.OwnerID, err.Content)
|
|
return fmt.Sprintf("public key already exists [owner_id: %d, content: %s]", err.OwnerID, err.Content)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
|
|
|
type ErrKeyNameAlreadyUsed struct {
|
|
type ErrKeyNameAlreadyUsed struct {
|
|
|
OwnerID int64
|
|
OwnerID int64
|
|
|
Name string
|
|
Name string
|
|
@@ -167,6 +178,7 @@ func (err ErrKeyNameAlreadyUsed) Error() string {
|
|
|
return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
|
|
return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
|
|
|
type ErrKeyAccessDenied struct {
|
|
type ErrKeyAccessDenied struct {
|
|
|
UserID int64
|
|
UserID int64
|
|
|
KeyID int64
|
|
KeyID int64
|
|
@@ -184,6 +196,7 @@ func (err ErrKeyAccessDenied) Error() string {
|
|
|
err.UserID, err.KeyID, err.Note)
|
|
err.UserID, err.KeyID, err.Note)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
|
|
|
type ErrDeployKeyNotExist struct {
|
|
type ErrDeployKeyNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
KeyID int64
|
|
KeyID int64
|
|
@@ -200,6 +213,7 @@ 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)
|
|
return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
|
|
|
type ErrDeployKeyAlreadyExist struct {
|
|
type ErrDeployKeyAlreadyExist struct {
|
|
|
KeyID int64
|
|
KeyID int64
|
|
|
RepoID int64
|
|
RepoID int64
|
|
@@ -215,6 +229,7 @@ func (err ErrDeployKeyAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
|
|
return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
|
|
|
type ErrDeployKeyNameAlreadyUsed struct {
|
|
type ErrDeployKeyNameAlreadyUsed struct {
|
|
|
RepoID int64
|
|
RepoID int64
|
|
|
Name string
|
|
Name string
|
|
@@ -230,6 +245,7 @@ func (err ErrDeployKeyNameAlreadyUsed) Error() string {
|
|
|
return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
|
|
return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
|
|
|
type ErrAccessTokenNotExist struct {
|
|
type ErrAccessTokenNotExist struct {
|
|
|
SHA string
|
|
SHA string
|
|
|
}
|
|
}
|
|
@@ -244,6 +260,7 @@ func (err ErrAccessTokenNotExist) Error() string {
|
|
|
return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
|
|
return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
|
|
|
type ErrAccessTokenEmpty struct {
|
|
type ErrAccessTokenEmpty struct {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -257,6 +274,7 @@ func (err ErrAccessTokenEmpty) Error() string {
|
|
|
return fmt.Sprintf("access token is empty")
|
|
return fmt.Sprintf("access token is empty")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
|
|
|
type ErrLastOrgOwner struct {
|
|
type ErrLastOrgOwner struct {
|
|
|
UID int64
|
|
UID int64
|
|
|
}
|
|
}
|
|
@@ -271,6 +289,7 @@ func (err ErrLastOrgOwner) Error() string {
|
|
|
return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
|
|
return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
|
|
|
type ErrRepoAlreadyExist struct {
|
|
type ErrRepoAlreadyExist struct {
|
|
|
Uname string
|
|
Uname string
|
|
|
Name string
|
|
Name string
|
|
@@ -286,6 +305,7 @@ func (err ErrRepoAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
|
|
return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
|
|
|
type ErrInvalidCloneAddr struct {
|
|
type ErrInvalidCloneAddr struct {
|
|
|
IsURLError bool
|
|
IsURLError bool
|
|
|
IsInvalidPath bool
|
|
IsInvalidPath bool
|
|
@@ -303,6 +323,7 @@ func (err ErrInvalidCloneAddr) Error() string {
|
|
|
err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
|
|
err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
|
|
|
type ErrUpdateTaskNotExist struct {
|
|
type ErrUpdateTaskNotExist struct {
|
|
|
UUID string
|
|
UUID string
|
|
|
}
|
|
}
|
|
@@ -317,6 +338,7 @@ func (err ErrUpdateTaskNotExist) Error() string {
|
|
|
return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
|
|
return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
|
|
|
type ErrReleaseAlreadyExist struct {
|
|
type ErrReleaseAlreadyExist struct {
|
|
|
TagName string
|
|
TagName string
|
|
|
}
|
|
}
|
|
@@ -331,6 +353,7 @@ func (err ErrReleaseAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
|
|
return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
|
|
|
type ErrReleaseNotExist struct {
|
|
type ErrReleaseNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
TagName string
|
|
TagName string
|
|
@@ -346,6 +369,7 @@ func (err ErrReleaseNotExist) Error() string {
|
|
|
return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
|
|
return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrInvalidTagName represents a "InvalidTagName" kind of error.
|
|
|
type ErrInvalidTagName struct {
|
|
type ErrInvalidTagName struct {
|
|
|
TagName string
|
|
TagName string
|
|
|
}
|
|
}
|
|
@@ -360,6 +384,7 @@ func (err ErrInvalidTagName) Error() string {
|
|
|
return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
|
|
return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
|
|
|
type ErrRepoFileAlreadyExist struct {
|
|
type ErrRepoFileAlreadyExist struct {
|
|
|
FileName string
|
|
FileName string
|
|
|
}
|
|
}
|
|
@@ -374,6 +399,7 @@ func (err ErrRepoFileAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
|
|
return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
|
|
|
type ErrPullRequestNotExist struct {
|
|
type ErrPullRequestNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
IssueID int64
|
|
IssueID int64
|
|
@@ -394,6 +420,7 @@ func (err ErrPullRequestNotExist) Error() string {
|
|
|
err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBarcnh, err.BaseBranch)
|
|
err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBarcnh, err.BaseBranch)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrCommentNotExist represents a "CommentNotExist" kind of error.
|
|
|
type ErrCommentNotExist struct {
|
|
type ErrCommentNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
IssueID int64
|
|
IssueID int64
|
|
@@ -409,6 +436,7 @@ func (err ErrCommentNotExist) Error() string {
|
|
|
return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
|
|
return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrLabelNotExist represents a "LabelNotExist" kind of error.
|
|
|
type ErrLabelNotExist struct {
|
|
type ErrLabelNotExist struct {
|
|
|
LabelID int64
|
|
LabelID int64
|
|
|
RepoID int64
|
|
RepoID int64
|
|
@@ -424,6 +452,7 @@ func (err ErrLabelNotExist) Error() string {
|
|
|
return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
|
|
return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
|
|
|
type ErrMilestoneNotExist struct {
|
|
type ErrMilestoneNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
RepoID int64
|
|
RepoID int64
|
|
@@ -439,6 +468,7 @@ func (err ErrMilestoneNotExist) Error() string {
|
|
|
return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
|
|
return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
|
|
|
type ErrAttachmentNotExist struct {
|
|
type ErrAttachmentNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
UUID string
|
|
UUID string
|
|
@@ -454,6 +484,7 @@ func (err ErrAttachmentNotExist) Error() string {
|
|
|
return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
|
|
return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
|
|
|
type ErrLoginSourceAlreadyExist struct {
|
|
type ErrLoginSourceAlreadyExist struct {
|
|
|
Name string
|
|
Name string
|
|
|
}
|
|
}
|
|
@@ -468,6 +499,7 @@ func (err ErrLoginSourceAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("login source already exists [name: %s]", err.Name)
|
|
return fmt.Sprintf("login source already exists [name: %s]", err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
|
|
|
type ErrLoginSourceInUse struct {
|
|
type ErrLoginSourceInUse struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
}
|
|
}
|
|
@@ -482,6 +514,7 @@ func (err ErrLoginSourceInUse) Error() string {
|
|
|
return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
|
|
return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
|
|
|
type ErrTeamAlreadyExist struct {
|
|
type ErrTeamAlreadyExist struct {
|
|
|
OrgID int64
|
|
OrgID int64
|
|
|
Name string
|
|
Name string
|
|
@@ -497,6 +530,7 @@ func (err ErrTeamAlreadyExist) Error() string {
|
|
|
return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
|
|
return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ErrUploadNotExist represents a "UploadNotExist" kind of error.
|
|
|
type ErrUploadNotExist struct {
|
|
type ErrUploadNotExist struct {
|
|
|
ID int64
|
|
ID int64
|
|
|
UUID string
|
|
UUID string
|