aboutsummaryrefslogtreecommitdiffstats
path: root/models/organization/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/organization/org.go')
-rw-r--r--models/organization/org.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/organization/org.go b/models/organization/org.go
index 044ea06563..fbbf6d04fa 100644
--- a/models/organization/org.go
+++ b/models/organization/org.go
@@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/util"
"xorm.io/builder"
)
@@ -45,6 +46,10 @@ func (err ErrOrgNotExist) Error() string {
return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
}
+func (err ErrOrgNotExist) Unwrap() error {
+ return util.ErrNotExist
+}
+
// ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
type ErrLastOrgOwner struct {
UID int64
@@ -73,6 +78,10 @@ func (err ErrUserNotAllowedCreateOrg) Error() string {
return "user is not allowed to create organizations"
}
+func (err ErrUserNotAllowedCreateOrg) Unwrap() error {
+ return util.ErrPermissionDenied
+}
+
// Organization represents an organization
type Organization user_model.User