Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-2126. Optimize NotLeaderException message #1124

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

weimingdiit
Copy link
Contributor

What changes were proposed in this pull request?

Optimize NotLeaderException message

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2126

How was this patch tested?

Original unit tests suite

@@ -30,7 +30,7 @@ public class NotLeaderException extends RaftException {
private final Collection<RaftPeer> peers;

public NotLeaderException(RaftGroupMemberId memberId, RaftPeer suggestedLeader, Collection<RaftPeer> peers) {
super("Server " + memberId + " is not the leader" + (suggestedLeader != null? " " + suggestedLeader: ""));
super("Server " + memberId + " is not the leader" + (suggestedLeader != null ? " ,suggested leader is: " + suggestedLeader : ""));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weimingdiit , thanks for working on this! The space should be after the comma, i.e. ", suggested ...".

Copy link
Contributor Author

@weimingdiit weimingdiit Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@szetszwo Ok, already updated, please review again

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@szetszwo
Copy link
Contributor

@weimingdiit , there is a checkstyle warning (long line). Could you fix it?

@weimingdiit
Copy link
Contributor Author

@weimingdiit , there is a checkstyle warning (long line). Could you fix it?
ok, please review again

@szetszwo szetszwo merged commit 011dc0a into apache:master Jul 30, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants