error management

A collection of 2 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Apr 21, 2024 Rust error management

The try block in Rust

I wrote previously about libs for error management in Rust. This week, I want to write about the try block, an experimental feature. The limit of the ? operator Please check the above article for a complete refresher on error management in general and the ? operator in particular. In short, ? allows to hook into a function call that returns a Result: If the Result contains a value, it continues normallyIf it contains an error, it short-circuits and returns the Result to the calling function.

Nicolas Fränkel
Feb 11, 2024 Rust error management

Error management in Rust, and libs that support it

As part of learning the Rust ecosystem, I dedicated the last few days to error management. Here are my findings. Error management 101 The Rust book describes the basics of error management. The language separates between recoverable errors and unrecoverable ones. Unrecoverable errors benefit from the panic!() macro. When Rust panics, it stops the program. Recoverable errors are much more enjoyable. Rust uses the Either monad, which stems from Functional Programming. Opposite to exceptions

Nicolas Fränkel
A Java geek © 2008-2025
v. cc175def46a5ea4416d57d241d859e495307e500/9964587441
Latest Posts