aboutsummaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/access.go')
-rw-r--r--models/access.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/access.go b/models/access.go
index 29d1a730b7..683282f336 100644
--- a/models/access.go
+++ b/models/access.go
@@ -4,6 +4,10 @@
package models
+import (
+ "fmt"
+)
+
type AccessMode int
const (
@@ -128,7 +132,7 @@ func (repo *Repository) recalculateAccesses(e Engine) error {
}
if err = team.getMembers(e); err != nil {
- return err
+ return fmt.Errorf("getMembers '%d': %v", team.ID, err)
}
for _, u := range team.Members {
accessMap[u.Id] = maxAccessMode(accessMap[u.Id], team.Authorize)
@@ -157,9 +161,9 @@ func (repo *Repository) recalculateAccesses(e Engine) error {
// Delete old accesses and insert new ones for repository.
if _, err = e.Delete(&Access{RepoID: repo.Id}); err != nil {
- return err
+ return fmt.Errorf("delete old accesses: %v", err)
} else if _, err = e.Insert(newAccesses); err != nil {
- return err
+ return fmt.Errorf("insert new accesses: %v", err)
}
return nil