<!-- {{# generate.module_header{} #}} -->
# Module :: `error_tools`
<!--{ generate.module_header.start() }-->
[](https://github.com/emersion/stability-badges#experimental) [](https://github.com/Wandalen/wTools/actions/workflows/module_error_tools_push.yml) [](https://docs.rs/error_tools) [](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Ferror_tools%2Fexamples%2Ferror_tools_trivial.rs,RUN_POSTFIX=--example%20module%2Fcore%2Ferror_tools%2Fexamples%2Ferror_tools_trivial.rs/https://github.com/Wandalen/wTools) [](https://discord.gg/m3YfbXpUUY)
<!--{ generate.module_header.end }-->
Basic exceptions handling mechanism.
### Basic use-case
<!-- {{# generate.module{} #}} -->
```rust ignore
#[ 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() )
}
```
<!-- qqq : investigate use-cases and write good documentation -->
<!-- qqq : make sure it work in no_std -->
### To add to your project
```sh
cargo add error_tools
```
### Try out from the repository
```sh
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example error_tools_trivial
```