|
|
@ -80,13 +80,20 @@ public class EnodeURLImpl implements EnodeURL { |
|
|
|
checkStringArgumentNotEmpty(value, "Invalid empty value."); |
|
|
|
checkStringArgumentNotEmpty(value, "Invalid empty value."); |
|
|
|
return fromURI(URI.create(value), enodeDnsConfiguration); |
|
|
|
return fromURI(URI.create(value), enodeDnsConfiguration); |
|
|
|
} catch (final IllegalArgumentException e) { |
|
|
|
} catch (final IllegalArgumentException e) { |
|
|
|
String message = |
|
|
|
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."; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
message = |
|
|
|
String.format( |
|
|
|
String.format( |
|
|
|
"Invalid enode URL syntax '%s'. Enode URL should have the following format 'enode://<node_id>@<ip>:<listening_port>[?discport=<discovery_port>]'.", |
|
|
|
"Invalid enode URL syntax '%s'. Enode URL should have the following format 'enode://<node_id>@<ip>:<listening_port>[?discport=<discovery_port>]'.", |
|
|
|
value); |
|
|
|
value); |
|
|
|
if (e.getMessage() != null) { |
|
|
|
if (e.getMessage() != null) { |
|
|
|
message += " " + e.getMessage(); |
|
|
|
message += " " + e.getMessage(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
throw new IllegalArgumentException(message, e); |
|
|
|
throw new IllegalArgumentException(message, e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|