10 breaking releases

0.12.0 Mar 26, 2024
0.10.0 Mar 16, 2024
0.4.0 Oct 29, 2023
0.1.4 Jun 12, 2022

#2063 in Development tools

Download history 42/week @ 2023-12-22 8/week @ 2023-12-29 21/week @ 2024-01-05 59/week @ 2024-01-12 25/week @ 2024-01-19 14/week @ 2024-01-26 10/week @ 2024-02-02 38/week @ 2024-02-09 73/week @ 2024-02-16 73/week @ 2024-02-23 426/week @ 2024-03-01 345/week @ 2024-03-08 579/week @ 2024-03-15 461/week @ 2024-03-22 135/week @ 2024-03-29 53/week @ 2024-04-05

1,311 downloads per month
Used in 54 crates (7 directly)

MIT license

16KB
241 lines

Module :: error_tools

experimentalrust-statusdocs.rsOpen 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::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

~155KB