aboutsummaryrefslogtreecommitdiffstats
path: root/models/organization/team.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/organization/team.go')
-rw-r--r--models/organization/team.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/organization/team.go b/models/organization/team.go
index bd80b1a8c7..83e5bd6fe1 100644
--- a/models/organization/team.go
+++ b/models/organization/team.go
@@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
+ "code.gitea.io/gitea/modules/util"
"xorm.io/builder"
)
@@ -43,6 +44,10 @@ func (err ErrTeamAlreadyExist) Error() string {
return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
}
+func (err ErrTeamAlreadyExist) Unwrap() error {
+ return util.ErrAlreadyExist
+}
+
// ErrTeamNotExist represents a "TeamNotExist" error
type ErrTeamNotExist struct {
OrgID int64
@@ -60,6 +65,10 @@ func (err ErrTeamNotExist) Error() string {
return fmt.Sprintf("team does not exist [org_id %d, team_id %d, name: %s]", err.OrgID, err.TeamID, err.Name)
}
+func (err ErrTeamNotExist) Unwrap() error {
+ return util.ErrNotExist
+}
+
// OwnerTeamName return the owner team name
const OwnerTeamName = "Owners"