When using a context selector, it's possible to automatically capture a backtrace:
read_file().context(FooSnafu)?;
Is it possible to avoid manually capturing a backtrace when there is no source error?
if !condition {
// currently I do this:
return Err(Error::Bar { backtrace: Backtrace });
// but would like to be able to do something like this:
return Err(BarSnafu.into());
}
Using this error type as an example:
When using a context selector, it's possible to automatically capture a backtrace:
Is it possible to avoid manually capturing a backtrace when there is no source error?
PS As always, thanks for
snafu
, it's rad.