superconsole
superconsole copied to clipboard
Consider not using anyhow::Error
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?
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<SuperConsoleError> for it). I think this would fit nicely with the solution for the #6.
@stepancheg - given the solution to #6 is now landed, how easy it is to do the error generalisation?