Hacker News new | ask | show | jobs
by rhabarba 400 days ago
I still prefer the Anyhow solution, but I like the approach here.
2 comments

Anyhow still makes things easier for application development. The main drawback is that the resulting error type doesn't implement std::error::Error, so it's not suitable for library development (as pointed out in the anyhow documentation). Stack Error is a bit less ergonomic, but suitable for library development.
Isn't this strictly superior to Anyhow? What do you like more about Anyhow?
I prefer Anyhow's non-intrusiveness: "Result" is still "Result" and all I need is a "?". I agree with Stack Error's documentation that Anyhow can't help with debugging that well, but it's "good enough" in my opinion.
Result in `anyhow::Result` though. It's still a different type. Or do you literally mean you like that it is still spelt the same?

And I think you can still use `?` with this if you don't want to add any context... Not 100% sure on that though.

Might as well be my limited understanding from what I can read behind the link, to be fair.