News for hackers. Stuff that matters.
Re:From Rust to TypeScript by kevinmgranger on Saturday September 12, 2020 @12:09PM (#24453455)
To add on to what other commenters have pointed out with `?`, there's also the interesting [fehler crate](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.

Re:From Rust to TypeScript by wwright on Saturday September 12, 2020 @01:00PM (#24453787)
I 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.

Re:From Rust to TypeScript by Nullabillity on Saturday September 12, 2020 @05:02PM (#24455641)
Pretty 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.
Re:From Rust to TypeScript by thramp on Saturday September 12, 2020 @05:51PM (#24456164)
fehler isn't deprecated, but _I_ did deprecate the similarly named https://github.com/rust-lang-nursery/failure/ with withoutboat's blessing.

failure proceeded fehler by several years.