From 9358698b70799b93a3731d0a7d89b3165d14106b Mon Sep 17 00:00:00 2001 From: PatStiles <33334338+PatStiles@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:35:29 -0300 Subject: [PATCH] fix(code quality): Improve error for S3 upload in Batcher (#1014) --- batcher/aligned-batcher/src/lib.rs | 2 +- batcher/aligned-batcher/src/types/errors.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/batcher/aligned-batcher/src/lib.rs b/batcher/aligned-batcher/src/lib.rs index 570d3cdd1..3e2ceed89 100644 --- a/batcher/aligned-batcher/src/lib.rs +++ b/batcher/aligned-batcher/src/lib.rs @@ -1018,7 +1018,7 @@ impl Batcher { &file_name, ) .await - .map_err(|e| BatcherError::TaskCreationError(e.to_string()))?; + .map_err(|e| BatcherError::BatchUploadError(e.to_string()))?; info!("Batch sent to S3 with name: {}", file_name); diff --git a/batcher/aligned-batcher/src/types/errors.rs b/batcher/aligned-batcher/src/types/errors.rs index f29a6e393..4cf9ecd2a 100644 --- a/batcher/aligned-batcher/src/types/errors.rs +++ b/batcher/aligned-batcher/src/types/errors.rs @@ -9,6 +9,7 @@ pub enum BatcherError { BatchVerifiedEventStreamError(String), EthereumSubscriptionError(String), SignatureError(SignatureError), + BatchUploadError(String), TaskCreationError(String), ReceiptNotFoundError, TransactionSendError, @@ -49,6 +50,9 @@ impl fmt::Debug for BatcherError { BatcherError::SignatureError(e) => { write!(f, "Message signature verification error: {}", e) } + BatcherError::BatchUploadError(e) => { + write!(f, "Uploading Batch was not successful: {}", e) + } BatcherError::TaskCreationError(e) => { write!(f, "Task creation error: {}", e) }