Error handling in Rust
Yes, it really is that complicated.  It's quite elegant in its way. If you start from the proposition that you don't want exceptions, you don't want Null, everything is strongly typed, error types are not hierarchical, and functional programming with lambdas is reasonable within sequential code, this is where you end up.  It's logical, but not fun.I wrote an RSS reader in Rust, and all the code required to compose all the error types (I/O, HTTP, XML, RSS, date formats) into a custom error type is as bulky as the modest amount of code that does the useful work.  That's not a good thing. Having to write all that error handling code up front is going to be a big problem for the Agile crowd.  This may be a major drag on Rust adoption.All this error machinery is in Rust to avoid exceptions.  That may have been a mistake. Exceptions have the good property that they can't be ignored - if they're not handled, you get a reasonable program termination.  If there's a reasonable exception hierarchy, you can catch an exception near the root of the tree and get all subsidiary exceptions.  (It took three major revisions of exception handling before Python got that right, but it finally did.) Rust doesn't have an error hierarchy like that; you can't just check for  "RuntimeError" or "EnvironmentError" and get all the more detailed errors. You have to combine error types yourself, as the article shows.I really want Rust to succeed, but I think they took a wrong turn with error handling.