maraiah: add backtrace macro

master
an 2019-07-01 01:23:08 -04:00
parent 19cf86b8bc
commit b16b2a7ff1
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@ macro_rules! bail {
};
}
#[macro_export]
macro_rules! backtrace {
($e:expr) => {
if cfg!(debug_assertions) {
dbg!($e.backtrace());
}
}
}
/// Returns an `Error` with a static string.
///
/// # Examples