error_tools

Crates.ioerror_tools
lib.rserror_tools
version0.19.0
sourcesrc
created_at2022-06-12 08:05:52.429108
updated_at2024-10-30 21:35:45.151618
descriptionBasic exceptions handling mechanism
homepagehttps://github.com/Wandalen/wTools/tree/master/module/core/error_tools
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/core/error_tools
max_upload_size
id604477
size32,157
Wandalen (Wandalen)

documentation

https://docs.rs/error_tools

README

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
Commit count: 0

cargo fmt