3 ms·
failure [1] is still state-of-the-art, even though it's deprecated. It will get you backtraces (if RUST_BACKTRACE=1 is set), which nothing else will. I'm waitin
by scottlamb 6y ago
failure [1] is still state-of-the-art, even though it's deprecated. It will get you backtraces (if RUST_BACKTRACE=1 is set), which nothing else will. I'm waiting until there are stable built-in backtraces [2] to switch to something else.
I recently tweaked my application's failure reporting [3] to go from this embarrassing thing:
E0211 073750.559 main moonfire_nvr] Sys(EROFS)
to the more useful:
E0211 111025.109 main moonfire_nvr] Exiting due to error: Failed to open dir /home/slamb/mymount/sample
caused by: Unable to open meta file
caused by: EROFS: Read-only file system
(set environment variable RUST_BACKTRACE=1 to see backtraces)
I should have thought long ago to advertise setting RUST_BACKTRACE=1 right in the error message, but better late than never.
[1] https://crates.io/crates/failure https://crates.io/crates/failure
[2] https://github.com/rust-lang/rust/pull/72981#issuecomment-726180149 https://github.com/rust-lang/rust/pull/72981#issuecomment-72...
[3] https://github.com/scottlamb/moonfire-nvr/commit/9a5957d5efa54977924bd803c81166ac9f5e1eac https://github.com/scottlamb/moonfire-nvr/commit/9a5957d5efa...