Where Everything Went Wrong: Error Handling and Error Messages in Rust (2020)
Error handling has been wrong since the beginning, and has continued to be wrong ever since.<p>First, we had error codes. Except these were wrong because people forget all the time to check them.<p>Then we had exceptions, which solved the problem of people forgetting to check by crashing the app.<p>Then the Java team got the bright idea to have checked exceptions, which at first helped to mitigate crashes from uncaught exception, but caused an explosion in thrown exception signatures, culminating in &quot;catch Throwable&quot;. Back to square one.<p>Then we got multi-return error objects, maybes, panics, and all sorts of bright ideas that fail to understand the basic premises of errors:<p>Any error system that relies upon developer discipline will fail because errors will be missed.<p>Any error system that handles all errors the same way will fail because there are some errors we can ignore, and some errors we must not ignore. And what&#x27;s ignorable&#x2F;retriable to one project is not ignorable&#x2F;retriable to another.<p>Attempting to get the complete set of error types that any given call may raise is a fool&#x27;s errand because of the halting problem it eventually invokes. Forcing people to provide such a list results in the Java problem for the same reason.<p>It&#x27;s a hard problem, which is why no one has solved it yet.