Conversation

I really loved rusts approach to errors but I haven't actually written anything with it, what's been aggravating in practice?
1
Honestly, everything. I don't find there's much to recommend the practice. You end up being forced to write a lot of boilerplate to handle errors that you just want to propagate (or you just call panic), and you lose a lot of the generic context of exceptions.
4
3
Right, you usually *can't* handle *all* the branches in an error sum. But you can usually handle one or two. You lose the guarantee that you handled those branches, unless you come up with a whole new ADT to represent it.
1
1
Yeah, brought this up here: twitter.com/brendanzab/sta - as stated there it could also save on the boilerplate in making a new error type whenever you want to combine existing errors.
Quote Tweet
Replying to @brendanzab @DRMacIver and @CartesianDaemon
Hypothetically, would extensible variants (like in OCaml) solve some of the boilerplate woes? I often find most of the bolierplate is in defining error types and the required `From` impls (I think there's a derive crate for those though).