You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2025/03/14 09:28:31 UTC

(nifi-minifi-cpp) 10/15: make exceptions in MultipartUploadStateStorage.cpp more readable

This is an automated email from the ASF dual-hosted git repository.

martinzink pushed a commit to branch minifi-api-property
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit cad3608831b52f39911634a1558eb81a320e0250
Author: Martin Zink <ma...@apache.org>
AuthorDate: Wed Mar 12 13:06:16 2025 +0100

    make exceptions in MultipartUploadStateStorage.cpp more readable
---
 extensions/aws/s3/MultipartUploadStateStorage.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/extensions/aws/s3/MultipartUploadStateStorage.cpp b/extensions/aws/s3/MultipartUploadStateStorage.cpp
index 076245dd8..e654d5e95 100644
--- a/extensions/aws/s3/MultipartUploadStateStorage.cpp
+++ b/extensions/aws/s3/MultipartUploadStateStorage.cpp
@@ -57,11 +57,11 @@ std::optional<MultipartUploadState> MultipartUploadStateStorage::getState(const
   MultipartUploadState state;
   state.upload_id = state_map[state_key + ".upload_id"];
 
-  state.upload_time_ms_since_epoch = parsing::parseIntegral<int64_t>(state_map[state_key + ".upload_time"]) | utils::expect("Expected parsable upload_time_ms_since_epoch");
-  state.uploaded_parts = parsing::parseIntegral<size_t>(state_map[state_key + ".uploaded_parts"]) | utils::expect("Expected parsable state.uploaded_parts");
-  state.uploaded_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".uploaded_size"]) | utils::expect("Expected parsable state.uploaded_size");
-  state.part_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".part_size"]) | utils::expect("Expected parsable state.part_size");
-  state.full_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".full_size"]) | utils::expect("Expected parsable state.full_size");
+  state.upload_time_ms_since_epoch = parsing::parseIntegral<int64_t>(state_map[state_key + ".upload_time"]) | utils::expect(fmt::format("Expected parsable {}.upload_time", state_key));
+  state.uploaded_parts = parsing::parseIntegral<size_t>(state_map[state_key + ".uploaded_parts"]) | utils::expect(fmt::format("Expected parsable {}.uploaded_parts", state_key));
+  state.uploaded_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".uploaded_size"]) | utils::expect(fmt::format("Expected parsable {}.uploaded_size", state_key));
+  state.part_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".part_size"]) | utils::expect(fmt::format("Expected parsable {}.part_size", state_key));
+  state.full_size = parsing::parseIntegral<uint64_t>(state_map[state_key + ".full_size"]) | utils::expect(fmt::format("Expected parsable {}.full_size", state_key));
   state.uploaded_etags = minifi::utils::string::splitAndTrimRemovingEmpty(state_map[state_key + ".uploaded_etags"], ";");
   return state;
 }