Skip to content

Commit 73aaf5f

Browse files
committed
Improve doc comments on DisplayErrorContext
1 parent 630409b commit 73aaf5f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

rust-runtime/aws-smithy-types/src/error/display.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ use std::fmt;
1010

1111
/// Provides a `Display` impl for an `Error` that outputs the full error context
1212
///
13-
/// This is useful for emitting errors with `tracing` in cases where the error
14-
/// is not returned back to the customer.
13+
/// This utility follows the error cause/source chain and displays every error message
14+
/// in the chain separated by ": ". At the end of the chain, it outputs a debug view
15+
/// of the entire error chain.
16+
///
17+
// Internally in the SDK, this is useful for emitting errors with `tracing` in cases
18+
// where the error is not returned back to the customer.
1519
#[derive(Debug)]
16-
pub struct DisplayErrorContext<E: Error>(pub E);
20+
pub struct DisplayErrorContext<E: Error>(
21+
/// The error to display full context for
22+
pub E,
23+
);
1724

1825
impl<E: Error> fmt::Display for DisplayErrorContext<E> {
1926
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)