| Most of these proposals miss the point. Errors need a useful taxonomy, based on what to do about them. The question is what do you do with an error after you caught it. A breakdown like this is needed: - Program is broken. Probably need to abort program. Example: subscript out of range. - Data from an external source is corrupted. Probably need to unwind transaction but program can continue. Example: bad UTF-8 string from input. - Connection to external device or network reports a problem. -- Retryable. Wait and try again a few times. Example: HTTP 5xx errors. -- Non-retryable. Give up now. Example: HTTP 4xx errors. Python 2 came close to that, but the hierarchy for Python 3 was worse. They tried; all errors are subclasses of a standard error hierarchy, but it doesn't break down well into what's retryable and what isn't. Rust never got this right, even with Anyhow. |