From the course: Rust Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Unrecoverable errors

Unrecoverable errors - Rust Tutorial

From the course: Rust Essential Training

Start my 1-month free trial

Unrecoverable errors

- [Instructor] We've seen a lot of errors throughout this course. Usually done on purpose to demonstrate a point, but nonetheless, errors are part of life when it comes to software. Fortunately, Rust has several features for handling errors to make our code more reliable. Now, when we're talking about errors here, we're not talking compilation errors that prevent your program from being built, we're talking about runtime errors that occur after your code has successfully compiled and is executing. Rust categorizes those errors into two categories, recoverable and unrecoverable. Recoverable errors are problems that your program can reasonably do something about to resolve. For example, if a user tries to open a file that doesn't exist, your program might display a message that the file was not found and tell them to try a different path. Unrecoverable errors are problems like indexing beyond the bounds of an array,…

Contents