anyhow
anyhow copied to clipboard
Make Error::from_std public
trafficstars
Make Error::from_std(impl StdError, Option<Backtrace>) public so a user can control whether capture backtrace or not.
Alternatively, Error may have constructors with an option to capture backtrace, like:
impl Error {
pub fn with_backtrace(impl StdError) { ... }
pub fn without_backtrace(impl StdError) { ... }
}
These are useful for:
- tests of error handling, like what is printed exactly
- make some errors cheaper or more detailed regardless of global setup