Closed
Description
When the ?
operator was implemented, it looks like it was meant to be equivalent to the try!
macro.
This has the nice property that overriding the try!
macro in your own project, allows you to capture all the ?
invocations and add additional logic like logging file and line number or wrapping that information into a new error object.
Sadly it seems that the ?
operator is no longer equivalent to the try!
macro. So overriding try!
does not change the behavior of ?
in your project. It would be awesome if this would be made possible.
Activity
jonas-schievink commentedon Apr 28, 2020
This is covered partially by #42327, and anything beyond that would require an RFC, so closing in favor of that.
stevenroose commentedon Apr 28, 2020
How would it work for the trait to know the file and line number where the error was generated?