Open dhouck opened 3 months ago
I wrote a piece about migrating a software project to SNAFU some years ago. Some of the parts are outdated, but the concept of anyhow relying on a dynamic error type still holds.
anyhow
andeyre
are mostly designed for applications, as they facilitate the aggregation of multiple error types into a single source of information about the error. This error can be expanded across the program stack via the extended context operator, hence gaining additional information. They deliberately employ a "kitchen-sink" error type, which is more complicated to take part in code flow if necessary. When it comes to libraries, structured error types are usually preferred.
I definitely prefer structure types in a lot of cases, but since snafu
has Whatever
also, it seems worth doing direct comparisons with that.
Like with #321, the Comparison page seems incomplete without a comparison between SNAFU and Anyhow. As far as I can tell the
Whatever
type in SNAFU is very similar to an Anyhow error, but I donʼt know enough about the details of either one to write a good comparison myself.