werror

Crates.iowerror
lib.rswerror
version0.4.0
sourcesrc
created_at2021-12-04 20:23:21.799025
updated_at2023-10-29 08:20:42.27115
descriptionBasic exceptions handling mechanism.
homepagehttps://github.com/Wandalen/wTools/tree/master/module/alias/werror
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/alias/werror
max_upload_size
id492363
size19,790
Wandalen (Wandalen)

documentation

https://docs.rs/werror

README

Module :: werror

experimental rust-status docs.rs discord

Basic exceptions handling mechanism.

Basic use-case.

fn main()
{
  let err = f1();
  println!( "{err:#?}" );
  // < Err(
  // <    BasicError {
  // <        msg: "Some error",
  // <    },
  // < )
}

fn f1() -> werror::Result< () >
{
  let _read = std::fs::read_to_string( "Cargo.toml" )?;
  Err( werror::BasicError::new( "Some error" ).into() )
}

To add to your project

cargo add werror

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example werror_tools_trivial
Commit count: 0

cargo fmt