Handle errors in Rust

Beginner
Student
Developer
Azure

In this module, you'll learn about ways to handle errors in Rust.

Learning objectives

In this module, you'll learn how to:

  • Use panic! to deal with unrecoverable errors.
  • Use the Option enum when a value is optional or the lack of a value is not an error condition.
  • Use the Result enum when things could go wrong and a caller might have to deal with the problem.

Prerequisites

  • A Rust development environment
  • Familiarity with creating, editing, and executing Rust code by using Cargo