#panic #error #option #bool #location #try #boolean #result #stringly-typed

tracked

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

10 releases (4 breaking)

Uses new Rust 2021

0.5.3 Oct 30, 2022
0.5.2 Jun 4, 2022
0.5.0 Apr 20, 2022
0.2.0 Mar 29, 2022

#373 in Rust patterns

Download history 235/week @ 2022-08-15 280/week @ 2022-08-22 241/week @ 2022-08-29 300/week @ 2022-09-05 239/week @ 2022-09-12 272/week @ 2022-09-19 276/week @ 2022-09-26 272/week @ 2022-10-03 248/week @ 2022-10-10 251/week @ 2022-10-17 301/week @ 2022-10-24 345/week @ 2022-10-31 280/week @ 2022-11-07 248/week @ 2022-11-14 319/week @ 2022-11-21 223/week @ 2022-11-28

1,106 downloads per month
Used in turbocharger

MIT OR Apache-2.0 OR CC0-1.0

5KB
132 lines

tracked

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
~21K SLoC