zltest icon indicating copy to clipboard operation
zltest copied to clipboard

[feature] .Err accessor on entry

Open draxil opened this issue 2 years ago • 0 comments

It's nice that we can assert whole errors for errors captured via .Err(err) or get the string representation with the "Str" accessor on the entry:

val, status := entry.Str(zerolog.ErrorFieldName)

But for testing errors wrapped in a particular way etc, it'd be nice to be able to retrieve the actual error type value, something like:

err, status := entry.Err(zerolog.ErrorFieldName)

draxil avatar Sep 07 '22 08:09 draxil