Aborts/Panics
This is the system Rust uses: There's a "result" type (Result<T>
) for recoverable errors, like a malformed URL in a HTTP library, and an "abort" function/macro (panic!
) for unrecoverable errors like indexing out of an array. Recoverable errors are returned from functions and can be processed like any other type, but unrecoverable errors crash the program instantly.