Skip to content

Commit fef6c4b

Browse files
authored
Improve retry observability logs (#522)
* Improve retry observability logs * Remove unused retry logging import
1 parent 39c5dbf commit fef6c4b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/rpc-client/src/utils.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Utility functions for async operations and coroutine execution.
22
3-
use log::{debug, warn};
3+
use log::warn;
44
use starknet::core::types::StarknetError;
55
use starknet::providers::ProviderError;
66
use std::future::Future;
@@ -84,7 +84,7 @@ where
8484
match f().await {
8585
Ok(result) => {
8686
if attempts > 1 {
87-
debug!("{operation_name}: succeeded after {attempts} attempts");
87+
warn!("{operation_name}: succeeded after {attempts} attempts");
8888
}
8989
return Ok(result);
9090
}
@@ -98,6 +98,10 @@ where
9898
if !is_retryable || attempts >= MAX_RETRY_ATTEMPTS {
9999
if attempts > 1 {
100100
warn!("{operation_name}: failed after {attempts} attempts with error: {e:?}");
101+
} else {
102+
warn!(
103+
"{operation_name}: failed on first attempt with error: {e:?} (retryable: {is_retryable})"
104+
);
101105
}
102106
return Err(e);
103107
}

0 commit comments

Comments
 (0)