diff options
Diffstat (limited to 'cpp/src/Ice/UdpEndpointI.cpp')
-rw-r--r-- | cpp/src/Ice/UdpEndpointI.cpp | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/cpp/src/Ice/UdpEndpointI.cpp b/cpp/src/Ice/UdpEndpointI.cpp index 11f7d565008..7574935e75d 100644 --- a/cpp/src/Ice/UdpEndpointI.cpp +++ b/cpp/src/Ice/UdpEndpointI.cpp @@ -198,9 +198,8 @@ IceInternal::UdpEndpointI::initWithOptions(vector<string>& args, bool oaEndpoint } else { - Ice::EndpointParseException ex(__FILE__, __LINE__); - ex.str = "`--interface *' not valid for proxy endpoint `" + toString() + "'"; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "`--interface *' not valid for proxy endpoint `" + + toString() + "'"); } } } @@ -385,9 +384,8 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum { if(!argument.empty()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "unexpected argument `" + argument + "' provided for -c option in " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "unexpected argument `" + argument + + "' provided for -c option in " + endpoint); } const_cast<bool&>(_connect) = true; } @@ -395,9 +393,8 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum { if(!argument.empty()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "unexpected argument `" + argument + "' provided for -z option in " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "unexpected argument `" + argument + + "' provided for -z option in " + endpoint); } const_cast<bool&>(_compress) = true; } @@ -405,9 +402,8 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum { if(argument.empty()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "no argument provided for " + option + " option in endpoint " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "no argument provided for " + option + + " option in endpoint " + endpoint); } try { @@ -418,20 +414,18 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum _instance->logger()->warning("deprecated udp endpoint option: " + option); } } - catch(const VersionParseException& e) + catch(const VersionParseException& ex) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "invalid version `" + argument + "' in endpoint " + endpoint + ":\n" + e.str; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "invalid version `" + argument + "' in endpoint " + + endpoint + ":\n" + ex.str); } } else if(option == "--interface") { if(argument.empty()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "no argument provided for --interface option in endpoint " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "no argument provided for --interface option in endpoint " + + endpoint); } const_cast<string&>(_mcastInterface) = argument; } @@ -439,16 +433,14 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum { if(argument.empty()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "no argument provided for --ttl option in endpoint " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "no argument provided for --ttl option in endpoint " + + endpoint); } istringstream p(argument); if(!(p >> const_cast<Int&>(_mcastTtl)) || !p.eof()) { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "invalid TTL value `" + argument + "' in endpoint " + endpoint; - throw ex; + throw EndpointParseException(__FILE__, __LINE__, "invalid TTL value `" + argument + "' in endpoint " + + endpoint); } } else |