Skip to content

Commit

Permalink
[MINOR] Include Enode URL in error message if parsing exception (hype…
Browse files Browse the repository at this point in the history
…rledger#6288)

* include the actual Enode URL in the error message if IP can't be resolved

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: jflo <[email protected]>
  • Loading branch information
macfarla authored and jflo committed Dec 18, 2023
1 parent e7ad48e commit 6d371a2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3246,7 +3246,7 @@ private List<EnodeURL> buildEnodes(
}

/**
* Besu CLI Paramaters exception handler used by VertX. Visible for testing.
* Besu CLI Parameters exception handler used by VertX. Visible for testing.
*
* @return instance of BesuParameterExceptionHandler
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public void nodeAllowlistCheckShouldNotWorkWithUnknownHostnameWhenOnlyDnsEnabled
true,
toml.toAbsolutePath().toString()))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining(
"Invalid IP address (or DNS query resolved an invalid IP). --Xdns-enabled is true but --Xdns-update-enabled flag is false.");
.hasMessageContaining("Invalid IP address");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public static EnodeURL fromString(
String message = "";
if (enodeDnsConfiguration.dnsEnabled() && !enodeDnsConfiguration.updateEnabled()) {
message =
"Invalid IP address (or DNS query resolved an invalid IP). --Xdns-enabled is true but --Xdns-update-enabled flag is false.";
String.format(
"Invalid IP address '%s' (or DNS query resolved an invalid IP). --Xdns-enabled is true but --Xdns-update-enabled flag is false.",
value);
} else {
message =
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public static class NonDeterministicOperationException extends RuntimeException
public Comparator<BlockHeader> getBlockChoiceRule() {
return (a, b) -> {
throw new NonDeterministicOperationException(
"ReferenceTestBlockchian for VMTest Chains do not support fork choice rules");
"ReferenceTestBlockchain for VMTest Chains do not support fork choice rules");
};
}

Expand Down

0 comments on commit 6d371a2

Please sign in to comment.