18 breaking releases

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

#196 in Algorithms

Download history 89/week @ 2025-01-05 111/week @ 2025-01-12 234/week @ 2025-01-19 95/week @ 2025-01-26 136/week @ 2025-02-02 87/week @ 2025-02-09 276/week @ 2025-02-16 255/week @ 2025-02-23 787/week @ 2025-03-02 746/week @ 2025-03-09 434/week @ 2025-03-16 303/week @ 2025-03-23 598/week @ 2025-03-30 546/week @ 2025-04-06 201/week @ 2025-04-13 433/week @ 2025-04-20

1,970 downloads per month
Used in 55 crates (12 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

~140KB