-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Describe the feature
The Error
enums in the different services implement std::error::Error
like so: impl std::error::Error for Error {}
. I believe they should implement Error::source()
properly by delegating to the contained error struct. This would be particularly valuable for the Unhandled
variant.
Use Case
I was trying to decrypt something using KMS
and kept getting an Unhandled error
without any other information. I thought something in my request was wrong but it turned out all it was was a missing permission, but it was hard to realise that as the source of the original error was lost (I was using anyhow
and relied on it to properly display the chain of causes).
Proposed Solution
I think the impl std::error::Error for Error{}
line in error_meta.rs
should be changed to something like:
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {
Self::Variant1(variant1) => variant1.source(),
...
}
}
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
A note for the community
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue, please leave a comment