The error handling project group aims to reduce confusion on how to structure error handling for users in the rust community. This will be accomplished by creating learning resources and pushing effort to upstream widely used crates into std. As a secondary goal this project group will also try to resolve some known issues with the Error trait and reporting errors in panics/termination.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use backtrace::Backtrace; | |
| use eyre::EyreHandler; | |
| use std::error::Error; | |
| use std::{fmt, iter}; | |
| fn main() -> eyre::Result<()> { | |
| // Install our custom eyre report hook for constructing our custom Handlers | |
| install().unwrap(); | |
| // construct a report with, hopefully, our custom handler! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use tracing_futures::Instrument; | |
| pub struct FancyGuard<'a> { | |
| span: &'a tracing::Span, | |
| entered: bool, | |
| } | |
| impl<'a> FancyGuard<'a> { | |
| pub fn new(span: &'a tracing::Span) -> FancyGuard<'a> { | |
| span.with_subscriber(|(id, sub)| sub.enter(id)).unwrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "depend/bitcoin/src" "-I" "depend/bitcoin/depends/x86_64-unknown-linux-gnu/include" "-Wall" "-Wextra" "-o" "/home/jlusby/git/zfnd/zcashconsensus/target/debug/build/bitcoinconsensus-10d848f2845186e9/out/depend/zcash/src/script/zcashconsensus.o" "-c" "depend/zcash/src/script/zcashconsensus.cpp" | |
| cargo:warning=In file included from /usr/include/x86_64-linux-gnu/sys/types.h:176, | |
| cargo:warning= from /usr/include/stdlib.h:394, | |
| cargo:warning= from /usr/include/c++/9/cstdlib:75, | |
| cargo:warning= from /usr/include/c++/9/ext/string_conversions.h:41, | |
| cargo:warning= from /usr/include/c++/9/bits/basic_string.h:6493, | |
| cargo:warning= from /usr/include/c++/9/string:55, | |
| cargo:warning= from /usr/include/c++/9/stdexcept:39, | |
| cargo:warning= from depend/bitcoin/src/uint256.h:11, | |
| cargo:warning= from |
OlderNewer