1
0
Fork 0
forked from forgejo/forgejo

#1575 Limit repo creation

This commit is contained in:
Unknwon 2015-12-10 12:37:53 -05:00
parent c6083c335e
commit 2a0bb1fa90
15 changed files with 73 additions and 14 deletions

View file

@ -107,6 +107,19 @@ func (err ErrUserHasOrgs) Error() string {
return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
}
type ErrReachLimitOfRepo struct {
Limit int
}
func IsErrReachLimitOfRepo(err error) bool {
_, ok := err.(ErrReachLimitOfRepo)
return ok
}
func (err ErrReachLimitOfRepo) Error() string {
return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
}
// __ __.__ __ .__
// / \ / \__| | _|__|
// \ \/\/ / | |/ / |