fix: error handling now displays page correctly, fixes #10777

This commit is contained in:
Torkel Ödegaard
2018-02-06 12:28:17 +01:00
parent 6e68c2069e
commit 0e61a670bb
7 changed files with 64 additions and 72 deletions
+2 -2
View File
@@ -40,14 +40,14 @@ func GenStateString() string {
func OAuthLogin(ctx *middleware.Context) {
if setting.OAuthService == nil {
ctx.Handle(404, "login.OAuthLogin(oauth service not enabled)", nil)
ctx.Handle(404, "OAuth not enabled", nil)
return
}
name := ctx.Params(":name")
connect, ok := social.SocialMap[name]
if !ok {
ctx.Handle(404, "login.OAuthLogin(social login not enabled)", errors.New(name))
ctx.Handle(404, fmt.Sprintf("No OAuth with name %s configured", name), nil)
return
}
+3 -1
View File
@@ -206,7 +206,9 @@ func (ctx *Context) Handle(status int, title string, err error) {
ctx.Data["Title"] = title
ctx.Data["AppSubUrl"] = setting.AppSubUrl
ctx.HTML(status, strconv.Itoa(status))
ctx.Data["Theme"] = "dark"
ctx.HTML(status, "error")
}
func (ctx *Context) JsonOK(message string) {
+1 -1
View File
@@ -137,7 +137,7 @@ func Recovery() macaron.Handler {
c.JSON(500, resp)
} else {
c.HTML(500, "500")
c.HTML(500, "error")
}
}
}()