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

Consider not using anyhow::Error #5

Open
wilfreddenton opened this issue Apr 4, 2023 · 2 comments
Open

Consider not using anyhow::Error #5

wilfreddenton opened this issue Apr 4, 2023 · 2 comments

Comments

@wilfreddenton
Copy link

I recently started using superconsole and I really like it. Thanks for making this! 🙏

The use of anyhow presents a bit of an ergonomics problem however. For example, in my application I use eyre and I have to manually map_err your anyhow errors to eyre::Reports. It seems that under the hood you are using thiserror to define errors. Perhaps these could be brought up to the surface instead of wrapping them in anyhow::Error?

@cjhopman
Copy link
Contributor

cjhopman commented Apr 4, 2023

One of the challenges is that superconsole needs to propagate errors up from Components. I guess we could resolve that by Component still using anyhow::Result and wrapping any errors in some superconsole error type. I think a better approach may be for the user to configure superconsole with the error type that they want (probably requiring that there's a From for it). I think this would fit nicely with the solution for the #6.

@ndmitchell
Copy link
Contributor

@stepancheg - given the solution to #6 is now landed, how easy it is to do the error generalisation?

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

3 participants