Skip to content

Commit c36e45e

Browse files
committed
Improve ambiguous error message
1 parent e3f13c1 commit c36e45e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/reconnect.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ where
215215
let connection_f = async move {
216216
let mut connection_result = Err(error::internal("Initial connection failed"));
217217
for i in 0..reconnect.0.reconnect_options.max_connection_attempts {
218+
let connection_count = i + 1;
218219
log::debug!(
219220
"Connection attempt {}/{}",
220-
i + 1,
221+
connection_count,
221222
reconnect.0.reconnect_options.max_connection_attempts
222223
);
223224
connection_result = match timeout(
@@ -230,7 +231,7 @@ where
230231
Err(_) => Err(error::internal(format!(
231232
"Connection timed-out after {} seconds",
232233
reconnect.0.reconnect_options.connection_timeout.as_secs()
233-
* reconnect.0.reconnect_options.max_connection_attempts
234+
* connection_count
234235
))),
235236
};
236237
if connection_result.is_ok() {

0 commit comments

Comments
 (0)