3 ms·
To add on to what other commenters have pointed out with `?`, there's also the interesting [fehler crate](https://github.com/withoutboats/fehler https://github.
by kevinmgranger 6y ago
To add on to what other commenters have pointed out with `?`, there's also the interesting [fehler crate](https://github.com/withoutboats/fehler https://github.com/withoutboats/fehler), which lets you write code that _looks_ like it uses exceptions.
It wouldn't make the examples that already use `?` any clearer, but it does reduce noise around the happy path.
- wwright 6y agoI believe that withoutboats has deprecated that, and now recommends anyhow (for applications) or thiserror (for libraries). I’ve tried them, and they really do take most of the toil out of defining errors.
- Nullabillity 6y agoPretty sure you're talking about Failure, not Fehler. Failure is (like Anyhow and Thiserror) for defining error types, Fehler is an alternate syntax for the functions that return those errors.
- thramp 6y agofehler isn't deprecated, but _I_ did deprecate the similarly named https://github.com/rust-lang-nursery/failure/ https://github.com/rust-lang-nursery/failure/ with withoutboat's blessing. failure proceeded fehler by several years.