Basic exceptions handling mechanism.
#[ 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() )
}
cargo add error_tools
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example error_tools_trivial