Closed
Description
SdkError
, and possibly other error types within the SDK, currently expose inner errors both through Error::source
and fmt::Display
:
The recommendation in the ecosystem is to either return inner errors through Error::source
or print the inner error in Display
, but never both (see rust-lang/project-error-handling#27 (comment), rust-lang/project-error-handling#23, rust-lang/api-guidelines#210), as otherwise errors end up being duplicated whenever error reporters print error backtraces. For example, I recently got an error trace that ended in:
6: failed to construct request: Failed to load credentials from the credentials provider: An error occurred while loading credentials: io error: error trying to connect: invalid certificate: UnknownIssuer
7: Failed to load credentials from the credentials provider: An error occurred while loading credentials: io error: error trying to connect: invalid certificate: UnknownIssuer