-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document that Error::source() types can not be depended on #2843
Comments
Is it not going to expose sources either? Since the opaque wrapping can only happen at the first level |
I suppose it "couldn't" expose the next source, since it can't wrap a reference, and exposing it would potentially include unstable dependencies... If the second option in #2844 happens, the unexposed sources would still be printable at least. |
I filed a proposal for the error handling WG, since that could affect the formatting needed for an "opaque" type. |
I suppose a question to consider is: is it fair to simply document "The types in |
imo that's fine. It's what axum does for extractor rejections. While not great I think its pragmatic and acceptable. |
Document that the exact types returned in the erased errors of `Error::source()` may change at any moment, and cannot be depended on. Closes #2843 BREAKING CHANGE: Do not build any logic depending on the exact types of an `Error::source()`. They are only for debugging.
Document that the exact types returned in the erased errors of `Error::source()` may change at any moment, and cannot be depended on. Closes #2843 BREAKING CHANGE: Do not build any logic depending on the exact types of an `Error::source()`. They are only for debugging.
Document that the exact types returned in the erased errors of `Error::source()` may change at any moment, and cannot be depended on. Closes #2843 BREAKING CHANGE: Do not build any logic depending on the exact types of an `Error::source()`. They are only for debugging.
…3318) Document that the exact types returned in the erased errors of `Error::source()` may change at any moment, and cannot be depended on. Closes hyperium#2843 BREAKING CHANGE: Do not build any logic depending on the exact types of an `Error::source()`. They are only for debugging.
…3318) Document that the exact types returned in the erased errors of `Error::source()` may change at any moment, and cannot be depended on. Closes hyperium#2843 BREAKING CHANGE: Do not build any logic depending on the exact types of an `Error::source()`. They are only for debugging. Signed-off-by: Sven Pfennig <[email protected]>
All sources/causes in
hyper::Error
should be wrapped in a privateOpaque
type that still prints (impl Debug
andimpl Display
) the message, but makes the type no longer leak througherr.downcast::<Blah>()
.The text was updated successfully, but these errors were encountered: