error_tools

Crates.ioerror_tools
lib.rserror_tools
version0.15.0
sourcesrc
created_at2022-06-12 08:05:52.429108
updated_at2024-06-29 18:07:46.499948
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
size47,277
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::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