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:
parent
0f295ababa
commit
ca00ca8ee4
4 changed files with 118 additions and 2 deletions
|
@ -136,6 +136,9 @@ func NewMacaron() *macaron.Macaron {
|
|||
DisableDebug: !setting.EnablePprof,
|
||||
}))
|
||||
m.Use(context.Contexter())
|
||||
// OK we are now set-up enough to allow us to create a nicer recovery than
|
||||
// the default macaron recovery
|
||||
m.Use(context.Recovery())
|
||||
m.SetAutoHead(true)
|
||||
return m
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue