Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Error::from_std public #301

Open
stepancheg opened this issue Mar 17, 2023 · 0 comments
Open

Make Error::from_std public #301

stepancheg opened this issue Mar 17, 2023 · 0 comments

Comments

@stepancheg
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant