From 9f66c2f76bc296b6b8e504e5ad8ad1b5c1723c70 Mon Sep 17 00:00:00 2001 From: Shirom Makkad Date: Fri, 1 Nov 2024 16:59:35 -0400 Subject: [PATCH] Get all extra metadata information Add `extras` function inside `ErrorMetadata` to get all extra error metadata without knowing the key. --- rust-runtime/aws-smithy-types/src/error/metadata.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust-runtime/aws-smithy-types/src/error/metadata.rs b/rust-runtime/aws-smithy-types/src/error/metadata.rs index 70c06c7e75b..8631f224dd7 100644 --- a/rust-runtime/aws-smithy-types/src/error/metadata.rs +++ b/rust-runtime/aws-smithy-types/src/error/metadata.rs @@ -128,6 +128,10 @@ impl ErrorMetadata { .as_ref() .and_then(|extras| extras.get(key).map(|k| k.as_str())) } + /// Returns all additional information about the error if it's present. + pub fn extras(&self) -> Option> { + self.extras + } /// Creates an `Error` builder. pub fn builder() -> Builder {