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

#890 in Development tools

Download history 563/week @ 2024-07-22 746/week @ 2024-07-29 240/week @ 2024-08-05 1320/week @ 2024-08-12 889/week @ 2024-08-19 2275/week @ 2024-08-26 1555/week @ 2024-09-02 1633/week @ 2024-09-09 348/week @ 2024-09-16 385/week @ 2024-09-23 347/week @ 2024-09-30 274/week @ 2024-10-07 421/week @ 2024-10-14 242/week @ 2024-10-21 653/week @ 2024-10-28 442/week @ 2024-11-04

1,768 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

~135KB