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

eyre!(x) where x: Arc<eyre::Report> loses trace #106

Open
Palmik opened this issue Sep 23, 2023 · 1 comment
Open

eyre!(x) where x: Arc<eyre::Report> loses trace #106

Palmik opened this issue Sep 23, 2023 · 1 comment

Comments

@Palmik
Copy link

Palmik commented Sep 23, 2023

Hi, when you for some reason have Arc<eyre::Report> and try to wrap it into a eyre::Report using eyre!(...), it loses traces from the report (previously added with wrap_err, etc.).

Why would you have Arc<eyre::Report> you ask? For example moka returns Arc wrapped errors from some of its functions.

@yaahc
Copy link
Collaborator

yaahc commented Sep 26, 2023

I believe this is happening because the macro can only tell that your type implements Display, and so it only uses that interface for reporting the inner error which ends up only printing the outermost error message. We can probably modify the auto deref specialization in the macro to also account for this and more smoothly handle Arc, tho it would be very specific to this exact use case which feels like a yellow flag design wise for me. I want to take more time to think before deciding to more forward in this direction.

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

2 participants