News for hackers. Stuff that matters.
Re:Rust: Enums to Wrap Multiple Errors by nagisa on Friday October 08, 2021 @03:44PM (#28803337)
Ah, I see.

In short, I consider `From::from` implementations for errors to be an anti-pattern. It is super easy to become lax about adding context with these implementations in place. Especially as code is modified in the future.

I describe the approach that I use for errors in a detail in an article (https://kazlauskas.me/entries/errors.html) that has already been linked elsewhere in the thread. It is, as far as I can tell, pretty much equivalent to what `snafu` makes users to do.

There are no comments on this comment yet.