-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for error::Report
#90172
Comments
Regarding the first unresolved issue about making it convert the inner type, I don't think its possible to do it generally, but I was able to add a special case for |
error::Report
I want to raise a concern on this related to naming. I think it's not unlikely that we may want to have a It might make more sense to call this |
Not sure whether it would be in scope of this issue, but would it be possible for a |
After some brief investigation, such an implementation would not work due to a conflicting blanket implementation in core. |
A little bit more context for the rationale, I encountered this error when trying to convert a
self
.map_err(E::from)
.map_err(Report::new)
.map_err(|report| report.pretty(true).show_backtrace(true))
``` |
Feature gate:
#![feature(error_reporter)]
This is a tracking issue for a
Report
type that wraps an error, allowing the entire error chain to be printed in either single- or multi-line format.Implementation PR: #91938
Public API
Unresolved Questions
impl<E> From<E> for Report<E> where E: Error
that converts an error into a report. Is it possible to make this work for types that convert into the inner error type?Edit(yaahc):
show_backtrace
currently has no effect if thepretty
format isn't enabled, we won't display backtraces ever in the single line format. I dislike this aspect, and am wondering if settingshow_backtrace
should implicitly also enablepretty
, which isn't necessarily much better, but at least it's less error prone.pretty
, in the docs we refer to it as the multi-line format, should it just bemultiline
?pretty
/show_backtrace
means you can't write something likelet val = my_result.map_err(Report::new).map_err(Report::pretty).unwrap();
, though I'm leaning towards this being the lesser evil compared to the issues with lifetimes and if statements on alternative builder API styles. It's not that big of a deal to introduce a closure like.map_err(|r| r.pretty(should_be_pretty))
The text was updated successfully, but these errors were encountered: