mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 19:41:00 +00:00
aws: use DisplayErrorContext when displaying SDK errors
As suggested in the aws crate documentation, wrap SDK errors with DisplayErrorContext so their Display implementation outputs the full context. Improve error display from "dispatch failure" to "dispatch failure: io error: error trying to connect: dns error: failed to lookup address information: Name or service not known: dns error: failed to lookup address information: Name or service not known: failed to lookup address information: Name or service not known (DispatchFailure(DispatchFailure { source: ConnectorError { kind: Io, source: hyper::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Name or service not known\" })), connection: Unknown } }))" Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1638>
This commit is contained in:
parent
3b7b2cd37b
commit
0ecbd3f953
1 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
|||
use aws_config::meta::region::RegionProviderChain;
|
||||
use aws_sdk_s3::{
|
||||
config::{timeout::TimeoutConfig, Credentials, Region},
|
||||
error::ProvideErrorMetadata,
|
||||
error::{DisplayErrorContext, ProvideErrorMetadata},
|
||||
primitives::{ByteStream, ByteStreamError},
|
||||
};
|
||||
use aws_types::sdk_config::SdkConfig;
|
||||
|
@ -46,7 +46,9 @@ impl<E: ProvideErrorMetadata + std::error::Error> fmt::Display for WaitError<E>
|
|||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
WaitError::Cancelled => f.write_str("Cancelled"),
|
||||
WaitError::FutureError(err) => write!(f, "{err}: {}", err.meta()),
|
||||
WaitError::FutureError(err) => {
|
||||
write!(f, "{}: {}", DisplayErrorContext(&err), err.meta())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue