summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-14 01:40:34 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-14 01:40:34 -0400
commit56cf05be771977abd9ae2e68dd446092c595981c (patch)
tree49e4bb385f199c0ec8ec6684256b340927d9565e /routers/repo/repo.go
parent47edf7f4f9d359765764207cbcb6dd82dba36de8 (diff)
downloadgitea-56cf05be771977abd9ae2e68dd446092c595981c.tar.gz
gitea-56cf05be771977abd9ae2e68dd446092c595981c.zip
Add errHandler mid ware
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index e1809b4b7e..1c9bb0500c 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -5,9 +5,10 @@
package repo
import (
+ "net/http"
+
"github.com/martini-contrib/render"
"github.com/martini-contrib/sessions"
- "net/http"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
@@ -15,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/log"
)
-func Create(form auth.CreateRepoForm, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) {
+func Create(form auth.CreateRepoForm, req *http.Request, r render.Render, data base.TmplData, session sessions.Session, eh log.ErrHandler) {
data["Title"] = "Create repository"
if req.Method == "GET" {
@@ -63,9 +64,7 @@ func Create(form auth.CreateRepoForm, req *http.Request, r render.Render, data b
return
}
- data["ErrorMsg"] = err
- log.Error("repo.Create: %v", err)
- r.HTML(200, "base/error", data)
+ eh.Handle("repo.Create", r, err)
}
func Delete(form auth.DeleteRepoForm, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) {