summaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-01-30 22:00:00 +0000
committertechknowlogick <matti@mdranta.net>2019-01-30 17:00:00 -0500
commitca00ca8ee450243b322457a0512ff338b6672494 (patch)
treec9ac742c5b86dc30e93d554bec21d244ba3e172f /routers/routes
parent0f295ababacfefc217053a3093c520970bc72296 (diff)
downloadgitea-ca00ca8ee450243b322457a0512ff338b6672494.tar.gz
gitea-ca00ca8ee450243b322457a0512ff338b6672494.zip
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>
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index c6b7a097ea..fad2724d2f 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -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
}