diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-12-10 13:41:49 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-12-10 13:41:49 -0800 |
commit | 47bc7e93cb03a077c0eef8a2cc871cead1212c00 (patch) | |
tree | 477aa3c5c77a5b458abc19b92c3ca12360c996a5 /java/src/IceInternal/TcpEndpointI.java | |
parent | Squashed commit of the following: (diff) | |
download | ice-47bc7e93cb03a077c0eef8a2cc871cead1212c00.tar.bz2 ice-47bc7e93cb03a077c0eef8a2cc871cead1212c00.tar.xz ice-47bc7e93cb03a077c0eef8a2cc871cead1212c00.zip |
bug 4355 - improve parse exception messages
Diffstat (limited to 'java/src/IceInternal/TcpEndpointI.java')
-rw-r--r-- | java/src/IceInternal/TcpEndpointI.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java index 27618d8ccc5..f331068a9e8 100644 --- a/java/src/IceInternal/TcpEndpointI.java +++ b/java/src/IceInternal/TcpEndpointI.java @@ -46,7 +46,8 @@ final class TcpEndpointI extends EndpointI String option = arr[i++]; if(option.length() != 2 || option.charAt(0) != '-') { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("expected an endpoint option but found `" + option + + "' in endpoint `tcp " + str + "'"); } String argument = null; @@ -65,7 +66,8 @@ final class TcpEndpointI extends EndpointI { if(argument == null) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("no argument provided for -h option in endpoint `tcp " + + str + "'"); } _host = argument; @@ -76,7 +78,8 @@ final class TcpEndpointI extends EndpointI { if(argument == null) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("no argument provided for -p option in endpoint `tcp " + + str + "'"); } try @@ -85,12 +88,14 @@ final class TcpEndpointI extends EndpointI } catch(NumberFormatException ex) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("invalid port value `" + argument + + "' in endpoint `tcp " + str + "'"); } if(_port < 0 || _port > 65535) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("port value `" + argument + + "' out of range in endpoint `tcp " + str + "'"); } break; @@ -100,7 +105,8 @@ final class TcpEndpointI extends EndpointI { if(argument == null) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("no argument provided for -t option in endpoint `tcp " + + str + "'"); } try @@ -109,7 +115,8 @@ final class TcpEndpointI extends EndpointI } catch(NumberFormatException ex) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("invalid timeout value `" + argument + + "' in endpoint `tcp " + str + "'"); } break; @@ -119,7 +126,8 @@ final class TcpEndpointI extends EndpointI { if(argument != null) { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("unexpected argument `" + argument + + "' provided for -z option in `tcp " + str + "'"); } _compress = true; @@ -128,7 +136,7 @@ final class TcpEndpointI extends EndpointI default: { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("unknown option `" + option + "' in `tcp " + str + "'"); } } } @@ -145,7 +153,7 @@ final class TcpEndpointI extends EndpointI } else { - throw new Ice.EndpointParseException("tcp " + str); + throw new Ice.EndpointParseException("`-h *' not valid for proxy endpoint `tcp " + str + "'"); } } |