<story><title>Error handling in Rust</title><url>http://blog.burntsushi.net/rust-error-handling/</url></story><parent_chain></parent_chain><comment><author>Animats</author><text>Yes, it really is that complicated.  It&amp;#x27;s quite elegant in its way. If you start from the proposition that you don&amp;#x27;t want exceptions, you don&amp;#x27;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&amp;#x27;s logical, but not fun.&lt;p&gt;I wrote an RSS reader in Rust, and all the code required to compose all the error types (I&amp;#x2F;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&amp;#x27;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.&lt;p&gt;All this error machinery is in Rust to avoid exceptions.  That may have been a mistake. Exceptions have the good property that they can&amp;#x27;t be ignored - if they&amp;#x27;re not handled, you get a reasonable program termination.  If there&amp;#x27;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&amp;#x27;t have an error hierarchy like that; you can&amp;#x27;t just check for  &amp;quot;RuntimeError&amp;quot; or &amp;quot;EnvironmentError&amp;quot; and get all the more detailed errors. You have to combine error types yourself, as the article shows.&lt;p&gt;I really want Rust to succeed, but I think they took a wrong turn with error handling.</text></comment>
<story><title>Error handling in Rust</title><url>http://blog.burntsushi.net/rust-error-handling/</url></story><parent_chain></parent_chain><comment><author>steveklabnik</author><text>One of the reasons I&amp;#x27;m really excited for stability is that people can start to write things like this, knowing that the effort is worth it, as it won&amp;#x27;t suddenly stop working tomorrow.&lt;p&gt;Next week, burntsushi and I are going to talk about rolling this into the official documentation.</text></comment>