]> source.dussan.org Git - gitea.git/commit
Ensure that template compilation panics are sent to the logs (#16788)
authorzeripath <art27@cantab.net>
Mon, 23 Aug 2021 19:40:59 +0000 (20:40 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Aug 2021 19:40:59 +0000 (20:40 +0100)
commit73defbbd1c070930563f17daa9e540c44a127928
tree30bd32b42eac15bd8bf074b57ae98a91b8912edc
parent94f529af02e74f5d13fefda48d3ef9db4559f71f
Ensure that template compilation panics are sent to the logs (#16788)

Although panics within the rendering pipeline are caught and dealt with,
panics that occur before that starts are unprotected and will kill Gitea
without being sent to the logs.

This PR adds a basic recovery handler to catch panics that occur after
the logger is initialised and ensure that they're sent to the logger.

Signed-off-by: Andrew Thornton <art27@cantab.net>
cmd/web.go