#error #location #information #bool #options #track-caller #stringly-typed

tracked

A stringly-typed Error that includes #[track_caller] information

11 releases

0.5.4 Apr 8, 2023
0.5.3 Oct 30, 2022
0.5.2 Jun 4, 2022
0.2.0 Mar 29, 2022

#559 in Rust patterns

Download history 80/week @ 2024-06-10 73/week @ 2024-06-17 73/week @ 2024-06-24 64/week @ 2024-07-01 64/week @ 2024-07-08 74/week @ 2024-07-15 67/week @ 2024-07-22 107/week @ 2024-07-29 55/week @ 2024-08-05 55/week @ 2024-08-12 49/week @ 2024-08-19 49/week @ 2024-08-26 48/week @ 2024-09-02 51/week @ 2024-09-09 48/week @ 2024-09-16 65/week @ 2024-09-23

218 downloads per month
Used in turbocharger

MIT OR Apache-2.0 OR CC0-1.0

7KB
132 lines

tracked

github crates.io docs.rs

A stringly-typed Error that includes #[track_caller] information.

Points you to the location in your code that errored, without the panic!.

Also lets you try an Option or a bool into a Result.

use tracked::tracked;

fn f() -> Option<()> {
    None
}

#[tracked]
fn main() -> Result<(), tracked::StringError> {
    true?;
    f()?;
    Ok(())
}
Error: NoneError in main at src/main.rs:10:8

Dependencies

~0.4–1MB
~23K SLoC