diff options
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index d7cc5955ab..170c2e90ba 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -105,7 +105,8 @@ func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoO opt.Gitignore, opt.License, opt.Private, false, opt.AutoInit) if err != nil { if err == models.ErrRepoAlreadyExist || - err == models.ErrRepoNameIllegal { + models.IsErrNameReserved(err) || + models.IsErrNamePatternNotAllowed(err) { ctx.JSON(422, &base.ApiJsonErr{err.Error(), base.DOC_URL}) } else { log.Error(4, "CreateRepository: %v", err) |