summaryrefslogtreecommitdiffstats
path: root/services/org/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/org/org.go')
-rw-r--r--services/org/org.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/org/org.go b/services/org/org.go
index b24b7e34c4..39845610d2 100644
--- a/services/org/org.go
+++ b/services/org/org.go
@@ -28,20 +28,20 @@ func DeleteOrganization(org *organization.Organization) error {
// Check ownership of repository.
count, err := repo_model.CountRepositories(ctx, repo_model.CountRepositoryOptions{OwnerID: org.ID})
if err != nil {
- return fmt.Errorf("GetRepositoryCount: %v", err)
+ return fmt.Errorf("GetRepositoryCount: %w", err)
} else if count > 0 {
return models.ErrUserOwnRepos{UID: org.ID}
}
// Check ownership of packages.
if ownsPackages, err := packages_model.HasOwnerPackages(ctx, org.ID); err != nil {
- return fmt.Errorf("HasOwnerPackages: %v", err)
+ return fmt.Errorf("HasOwnerPackages: %w", err)
} else if ownsPackages {
return models.ErrUserOwnPackages{UID: org.ID}
}
if err := organization.DeleteOrganization(ctx, org); err != nil {
- return fmt.Errorf("DeleteOrganization: %v", err)
+ return fmt.Errorf("DeleteOrganization: %w", err)
}
if err := commiter.Commit(); err != nil {
@@ -54,13 +54,13 @@ func DeleteOrganization(org *organization.Organization) error {
path := user_model.UserPath(org.Name)
if err := util.RemoveAll(path); err != nil {
- return fmt.Errorf("Failed to RemoveAll %s: %v", path, err)
+ return fmt.Errorf("Failed to RemoveAll %s: %w", path, err)
}
if len(org.Avatar) > 0 {
avatarPath := org.CustomAvatarRelativePath()
if err := storage.Avatars.Delete(avatarPath); err != nil {
- return fmt.Errorf("Failed to remove %s: %v", avatarPath, err)
+ return fmt.Errorf("Failed to remove %s: %w", avatarPath, err)
}
}