Hello!
I upgraded from zerolog v1.31.0 to v1.35.0 and some of my tests validating log format started failing. I use the https://github.com/elastic/ecs-logging-go-zerolog library to enforce a formatting standard and saw that the error messages stopped appearing.
I tracked the issue to this commit:
f6fbd33#diff-552f47512a00afe5fc6850cc9ddc830a6daeca162750e50aab4ed549685e0253R187
Before, when ErrorStackMarshaller(err).(type) returned nil we would fall through the switch case and execute return e.AnErr(ErrorFieldName, err). This ensured that a regular error without stack wrapping would still get marshalled.
After the commit, the function started returning the event unchanged, as if the error was nil which is not the case. How should I deal with this behaviour change?
Hello!
I upgraded from zerolog v1.31.0 to v1.35.0 and some of my tests validating log format started failing. I use the https://github.com/elastic/ecs-logging-go-zerolog library to enforce a formatting standard and saw that the error messages stopped appearing.
I tracked the issue to this commit:
f6fbd33#diff-552f47512a00afe5fc6850cc9ddc830a6daeca162750e50aab4ed549685e0253R187
Before, when
ErrorStackMarshaller(err).(type)returnednilwe would fall through the switch case and executereturn e.AnErr(ErrorFieldName, err). This ensured that a regular error without stack wrapping would still get marshalled.After the commit, the function started returning the event unchanged, as if the error was
nilwhich is not the case. How should I deal with this behaviour change?