The more I use sum types for error handling the more convinced I am that exceptions are very good, actually.
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
Definitely agree with the loss of backtraces, although sometimes the overhead of supporting them is too great. The failure's crate's Error type is neat, because you can just cast to it an be done with it - also supports backtraces if you can afford them.
1
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).


