9 unstable releases (3 breaking)

0.4.0 Oct 29, 2023
0.3.0 Oct 28, 2023
0.1.3 Jun 12, 2022
0.1.2 May 25, 2022
0.0.2 Dec 22, 2021

#18 in #exception

Download history 19/week @ 2024-03-08 25/week @ 2024-03-15 3/week @ 2024-03-22 37/week @ 2024-03-29 9/week @ 2024-04-05 6/week @ 2024-04-12 5/week @ 2024-04-19 5/week @ 2024-04-26 3/week @ 2024-05-03 4/week @ 2024-05-10

1,232 downloads per month

MIT license

26KB
357 lines

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

Dependencies

~140KB