18 breaking releases

new 0.20.0 Apr 5, 2025
0.19.0 Oct 30, 2024
0.18.0 Oct 30, 2024
0.15.0 Jun 29, 2024
0.1.4 Jun 12, 2022

#296 in Algorithms

Download history 647/week @ 2024-12-16 128/week @ 2024-12-23 164/week @ 2024-12-30 90/week @ 2025-01-06 110/week @ 2025-01-13 238/week @ 2025-01-20 90/week @ 2025-01-27 134/week @ 2025-02-03 108/week @ 2025-02-10 256/week @ 2025-02-17 257/week @ 2025-02-24 790/week @ 2025-03-03 767/week @ 2025-03-10 408/week @ 2025-03-17 319/week @ 2025-03-24 600/week @ 2025-03-31

2,107 downloads per month
Used in 58 crates (10 directly)

MIT license

27KB
422 lines

Module :: error_tools

experimental rust-status docs.rs Open in Gitpod discord

Basic exceptions handling mechanism.

Basic use-case

#[ cfg( feature = "enabled" ) ]
fn main()
{
  let err = f1();
  println!( "{err:#?}" );
  // < Err(
  // <    BasicError {
  // <        msg: "Some error",
  // <    },
  // < )
}

#[ cfg( feature = "enabled" ) ]
fn f1() -> error_tools::untyped::Result< () >
{
  let _read = std::fs::read_to_string( "Cargo.toml" )?;
  Err( error_tools::BasicError::new( "Some error" ).into() )
}

To add to your project

cargo add error_tools

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example error_tools_trivial

Dependencies

~135KB