mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 07:29:03 -04:00
logging: Always set fields func; fix #6829
This commit is contained in:
parent
96c5c554c1
commit
932dac157a
@ -195,6 +195,7 @@ func (sa *StringArray) UnmarshalJSON(b []byte) error {
|
|||||||
// have richer information.
|
// have richer information.
|
||||||
func errLogValues(err error) (status int, msg string, fields func() []zapcore.Field) {
|
func errLogValues(err error) (status int, msg string, fields func() []zapcore.Field) {
|
||||||
var handlerErr HandlerError
|
var handlerErr HandlerError
|
||||||
|
fields = func() []zapcore.Field { return []zapcore.Field{} } // don't be nil (fix #6829)
|
||||||
if errors.As(err, &handlerErr) {
|
if errors.As(err, &handlerErr) {
|
||||||
status = handlerErr.StatusCode
|
status = handlerErr.StatusCode
|
||||||
if handlerErr.Err == nil {
|
if handlerErr.Err == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user