11 breaking releases

new 0.13.0 May 11, 2024
0.12.0 Mar 26, 2024
0.11.0 Mar 16, 2024
0.4.0 Oct 29, 2023
0.1.4 Jun 12, 2022

#2340 in Development tools

Download history 23/week @ 2024-01-20 9/week @ 2024-01-27 13/week @ 2024-02-03 40/week @ 2024-02-10 74/week @ 2024-02-17 170/week @ 2024-02-24 430/week @ 2024-03-02 318/week @ 2024-03-09 521/week @ 2024-03-16 450/week @ 2024-03-23 138/week @ 2024-03-30 59/week @ 2024-04-06 62/week @ 2024-04-13 58/week @ 2024-04-20 59/week @ 2024-04-27 63/week @ 2024-05-04

244 downloads per month
Used in 54 crates (7 directly)

MIT license

16KB
241 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::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