Skip to content

Commit

Permalink
Clarify the reason the swarm can't connect
Browse files Browse the repository at this point in the history
  • Loading branch information
EightFactorial committed Nov 29, 2024
1 parent ec5e4ad commit 72e1a23
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion azalea/src/swarm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,17 @@ impl Swarm {
let delay = (Duration::from_secs(5) * 2u32.pow(disconnects.min(16)))
.min(Duration::from_secs(15));
let username = account.username.clone();
error!("Error joining as {username}: {e}. Waiting {delay:?} and trying again.");

if let JoinError::Disconnect { reason } = &e {
error!(
"Error joining as {username}, server says: \"{reason}\". Waiting {delay:?} and trying again."
);
} else {
error!(
"Error joining as {username}: {e}. Waiting {delay:?} and trying again."
);
}

tokio::time::sleep(delay).await;
}
}
Expand Down

0 comments on commit 72e1a23

Please sign in to comment.