uerr

uerr is a crate which provides stunning visual error handling.

Showcase

Using the code below, we can display a simple error and show it to the user.

```rust use uerr::UserError;

[test]

fn sampleerror() { UserError::from("could not open file") .andreason("The system cannot find the file specified.") .andhelp("Does this file exist?") .printall("uerr/error: "); } ```

Output

text uerr/error: could not open file - caused by: The system cannot find the file specified. + help: Does this file exist?

With multiple arguments

text program.exe: could not open file - caused by: The system cannot find the file specified. | Filler reason. + help: Does this file exist? | Filler help.

Click to see the code.

```rust

[test]

fn sampleerror() { UserError::from("could not open file") .andreason("The system cannot find the file specified.") .andreason("Filler reason.") .andhelp("Does this file exist?") .andhelp("Filler help.") .printall("program.exe: "); } ```

Exiting with errors

The UserError struct also supports inline exiting.

```rust

[test]

fn sampleerror() { UserError::from("Sample Error") .printall("my program: ") .exit(-1); } ```