mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 05:27:20 +00:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user