Skip to content

Details

https://secure.meetupstatic.com/photos/event/2/1/8/e/600_464528590.jpeg

Note: This meetup is in logical continuation of the Rust IO (Sep 16) meetup.

Rust IO and Error Handling workshop

Error Handling

Rust’s commitment to reliability extends to error handling. This is seen in great detail in situations that involve IO.

Rust groups errors into two major categories: recoverable and unrecoverable errors. Rust doesn’t have exceptions. Instead, it has

  • value Result for recoverable errors
  • panic! macro that stops execution when it encounters unrecoverable errors.

we discuss the pathology of the code structured as shown below

pub fn get_id(&mut self) -> Result {
let update_result = self.update();
match update_result {
Ok(_) => Ok(self.construct_id()),
Err(err) => Err(err),
} }

Members are also interested in