# README [crates.io](https://crates.io/crates/printjsonerr) [docs.rs](https://docs.rs/printjsonerr) [github](https://codeberg.org/AlbanMinassian/errorjson) [printjsonerr](https://crates.io/crates/printjsonerr) help to print json error ## Usage ```rust use jsonerr::*; use printjsonerr::*; fn main() { let myjsonerr: serde_json::Value = jsonerr!(code = "ERR001", message = "An error message"); printjsonerr!(myjsonerr); // without & (added internaly) printjsonerr!(&myjsonerr); // with & } ``` print ```bash ┌---------------------------- | meta: errjson/examples/full.rs, line=45, function=main() | ERR0001: Error when main() call myfnc() | origin: | ┌---------------------------- | | meta: errjson/examples/full.rs, line=29, function=myfnc() | | ERR0002: Error when myfnc() call mysubfnc() | | origin: | | ┌---------------------------- | | | meta: errjson/examples/full.rs, line=12, function=mysubfnc() | | | ERR003: Error when mysubfnc() call mysubsubfnc() | | | origin: | | | ┌---------------------------- | | | | std:error:Error: No such file or directory (os error 2) ``` ## Examples - `cargo run --example basic`