internal/server: Log unknown errors

This commit updates the server code to log unknown errors to the
console.
This commit is contained in:
Tom Wiesing 2023-03-06 22:32:03 +01:00
parent 751f5a6074
commit 2ee8dfaaec
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View file

@ -121,3 +121,9 @@ func (server *Server) csrf() func(http.Handler) http.Handler {
opts = append(opts, csrf.FieldName(CSRFCookieField))
return csrf.Protect(server.Config.CSRFSecret(), opts...)
}
func init() {
httpx.InterceptorOnFallback = func(req *http.Request, err error) {
zerolog.Ctx(req.Context()).Err(err).Msg("unknown error intercepted")
}
}