From 68d1d1b003bab6f7400cfb3b82ba51369f00f060 Mon Sep 17 00:00:00 2001 From: Omar Ramadan Date: Wed, 8 Jan 2025 12:35:18 -0800 Subject: [PATCH] Fixes crash if logging error is not HandlerError --- modules/caddyhttp/logging.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/caddyhttp/logging.go b/modules/caddyhttp/logging.go index 0a389fe1..87298ac3 100644 --- a/modules/caddyhttp/logging.go +++ b/modules/caddyhttp/logging.go @@ -211,6 +211,11 @@ func errLogValues(err error) (status int, msg string, fields func() []zapcore.Fi } return } + fields = func() []zapcore.Field { + return []zapcore.Field{ + zap.Error(err), + } + } status = http.StatusInternalServerError msg = err.Error() return