error_tools 0.32.0

Basic exceptions handling mechanism
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! A trivial example for `error_tools`.

use error_tools::untyped::{Result};

fn get_message() -> Result<&'static str> {
  Ok("Hello, world!")
  // Err( format_err!( "An unexpected error!" ) )
}

fn main() {
  match get_message() {
    Ok(msg) => println!("Success: {msg}"),
    Err(e) => println!("Error: {e:?}"),
  }
}