News for hackers. Stuff that matters.
Re:Overview of Rust error handling libraries by epage on Friday November 22, 2019 @04:54PM (#21610524)
> which seems like a really clumsy way to handle it. In most real cases, wouldn't you write the From impls for the specific types of errors you're expecting?

In an application, yes. The problem is in libraries because the `From`s` are public so you have put the error type for your dependency in your public API and if you change dependencies or upgrade past a major, you've broken your API. Granted, it is unlikely someone is going to use it ... but I wouldn't put it past people to take shortcuts like that.

Re:Overview of Rust error handling libraries by shepmaster on Friday November 22, 2019 @09:04PM (#21611937)
A benefit of SNAFU is that the `From` trait is implemented against the internal-by-default context selectors. Since enum variants are public if the enum is, SNAFU also offers a way to wrap an opaque newtype around the internal error, allowing the implementor to choose exactly what public API their error exposes.