diff options
author | Unknwon <u@gogs.io> | 2015-02-24 00:27:22 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-02-24 00:27:22 -0500 |
commit | 8896c82d34ec5d86af1eeafb8c55a06f81bd3af1 (patch) | |
tree | 6b71dc1f8b609a957769dd8d5d0af485205fba2b /models/access.go | |
parent | f92bfabf864bf7fae19777a537986fffcef0c873 (diff) | |
download | gitea-8896c82d34ec5d86af1eeafb8c55a06f81bd3af1.tar.gz gitea-8896c82d34ec5d86af1eeafb8c55a06f81bd3af1.zip |
models: fix issue with transfer repository
README: fix typo
Diffstat (limited to 'models/access.go')
-rw-r--r-- | models/access.go | 10 |
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 |