17 breaking releases

0.19.0 Oct 30, 2024
0.17.0 Sep 5, 2024
0.15.0 Jun 29, 2024
0.12.0 Mar 26, 2024
0.1.4 Jun 12, 2022

#707 in Development tools

Download history 1341/week @ 2024-08-16 1510/week @ 2024-08-23 2247/week @ 2024-08-30 1661/week @ 2024-09-06 410/week @ 2024-09-13 370/week @ 2024-09-20 340/week @ 2024-09-27 209/week @ 2024-10-04 500/week @ 2024-10-11 252/week @ 2024-10-18 529/week @ 2024-10-25 431/week @ 2024-11-01 442/week @ 2024-11-08 271/week @ 2024-11-15 442/week @ 2024-11-22 1244/week @ 2024-11-29

2,431 downloads per month
Used in 54 crates (9 directly)

MIT license

23KB
417 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

~140KB