Provide better panic handling (#5902)

This PR gitea'ises the macaron.Recovery() handler meaning that in
the event of panic we get proper gitea 500 pages and the stacktrace
is logged with the gitea logger.

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2019-01-30 22:00:00 +00:00 committed by techknowlogick
parent 0f295ababa
commit ca00ca8ee4
4 changed files with 118 additions and 2 deletions

View file

@ -136,7 +136,7 @@ func (ctx *Context) ServerError(title string, err error) {
}
ctx.Data["Title"] = "Internal Server Error"
ctx.HTML(404, base.TplName("status/500"))
ctx.HTML(http.StatusInternalServerError, base.TplName("status/500"))
}
// NotFoundOrServerError use error check function to determine if the error