errloc_macros 0.1.0

Error location utility macros
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 1 items with examples
  • Size
  • Source code size: 16.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.12 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • rustytools/errloc_macros
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rustytools

Error location utility macros

This project containst two utility macros and a function that can make the use of std::panic::catch_unwind more convenient.

Plese note, that stack unwinding is not an idiomatic Rust error handling (but may be useful nonetheless).

Usage example

    #[macro_use]
    extern crate errloc_macros;

    std::panic::catch_unwind(|| {
        foo.api_call_that_shoud_not_fail.expect(errloc!());
    }).unwrap_or_else(|e| {
        // output will include the location of "expect" call
        println!("Fatal fail: {:?}", errloc_macros::msg(&e));
    });

License information

This project is released under the Apache License 2.0.

Changelog

2017-05-13

  • version 0.1.0
  • initial public version