aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-26 17:11:47 -0400
committerUnknwon <u@gogs.io>2015-03-26 17:11:47 -0400
commit698b9e2acc4daafe7d2b314e2d8c96545dde9c40 (patch)
tree8d593bb0816503494de4deb16ee0fa6b95eb3c5c /routers/api
parentd76f11c6f14b69bf981e5fc3901cc2c6445773b8 (diff)
downloadgitea-698b9e2acc4daafe7d2b314e2d8c96545dde9c40.tar.gz
gitea-698b9e2acc4daafe7d2b314e2d8c96545dde9c40.zip
#1070 Clearer error message for illegal characters
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo.go3
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)