Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] .Err accessor on entry #2

Open
draxil opened this issue Sep 7, 2022 · 0 comments
Open

[feature] .Err accessor on entry #2

draxil opened this issue Sep 7, 2022 · 0 comments

Comments

@draxil
Copy link

draxil commented Sep 7, 2022

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 draxil changed the title Would be nice to have a .Err accessor [feature] .Err accessor on entry Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant