diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Glacier2Lib/SessionHelper.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 16 | ||||
-rw-r--r-- | cpp/src/IceSSL/OpenSSLCertificateI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceSSL/SChannelCertificateI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceSSL/SecureTransportCertificateI.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/ami/AllTests.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/binding/AllTests.cpp | 3 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Oneways.cpp | 16 | ||||
-rw-r--r-- | cpp/test/Ice/operations/OnewaysAMI.cpp | 28 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/AllTests.cpp | 36 |
10 files changed, 95 insertions, 24 deletions
diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index 3891e31ab7f..b5d436c7503 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -1041,7 +1041,11 @@ Glacier2::SessionFactoryHelper::setProtocol(const string& protocol) protocol != "ws" && protocol != "wss") { +#ifdef ICE_CPP11_MAPPING + throw invalid_argument("Unknown protocol `" + protocol + "'"); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Unknown protocol `" + protocol + "'"); +#endif } _protocol = protocol; } diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index b46545c35c1..7b7a7311fa6 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -239,9 +239,7 @@ Ice::ObjectPrx::_checkTwowayOnly(const string& name) const // if(!ice_isTwoway()) { - throw IceUtil::IllegalArgumentException(__FILE__, - __LINE__, - "`" + name + "' can only be called with a twoway proxy"); + throw Ice::TwowayOnlyException(__FILE__, __LINE__, name); } } @@ -852,7 +850,11 @@ ICE_OBJECT_PRX::ice_locatorCacheTimeout(Int newTimeout) const { ostringstream s; s << "invalid value passed to ice_locatorCacheTimeout: " << newTimeout; +#ifdef ICE_CPP11_MAPPING + throw invalid_argument(s.str()); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, s.str()); +#endif } if(newTimeout == _reference->getLocatorCacheTimeout()) { @@ -1059,7 +1061,11 @@ ICE_OBJECT_PRX::ice_invocationTimeout(Int newTimeout) const { ostringstream s; s << "invalid value passed to ice_invocationTimeout: " << newTimeout; +#ifdef ICE_CPP11_MAPPING + throw invalid_argument(s.str()); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, s.str()); +#endif } if(newTimeout == _reference->getInvocationTimeout()) { @@ -1201,7 +1207,11 @@ ICE_OBJECT_PRX::ice_timeout(int t) const { ostringstream s; s << "invalid value passed to ice_timeout: " << t; +#ifdef ICE_CPP11_MAPPING + throw invalid_argument(s.str()); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, s.str()); +#endif } ReferencePtr ref = _reference->changeTimeout(t); if(ref == _reference) diff --git a/cpp/src/IceSSL/OpenSSLCertificateI.cpp b/cpp/src/IceSSL/OpenSSLCertificateI.cpp index 03c0d304d51..afdd6b7c815 100644 --- a/cpp/src/IceSSL/OpenSSLCertificateI.cpp +++ b/cpp/src/IceSSL/OpenSSLCertificateI.cpp @@ -349,7 +349,11 @@ OpenSSLCertificateI::OpenSSLCertificateI(x509_st* cert) : _cert(cert) { if(!_cert) { +#ifdef ICE_CPP11_MAPPING + throw invalid_argument("Invalid certificate reference"); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Invalid certificate reference"); +#endif } } diff --git a/cpp/src/IceSSL/SChannelCertificateI.cpp b/cpp/src/IceSSL/SChannelCertificateI.cpp index c0a357fd63e..0767bd4efb9 100644 --- a/cpp/src/IceSSL/SChannelCertificateI.cpp +++ b/cpp/src/IceSSL/SChannelCertificateI.cpp @@ -312,7 +312,11 @@ SChannelCertificateI::SChannelCertificateI(CERT_SIGNED_CONTENT_INFO* cert) : { if(!_cert) { +#ifdef ICE_CPP11_MAPPING + throw invalid_argument("Invalid certificate reference"); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Invalid certificate reference"); +#endif } try diff --git a/cpp/src/IceSSL/SecureTransportCertificateI.cpp b/cpp/src/IceSSL/SecureTransportCertificateI.cpp index 0e90b61ae00..00b60e1854b 100644 --- a/cpp/src/IceSSL/SecureTransportCertificateI.cpp +++ b/cpp/src/IceSSL/SecureTransportCertificateI.cpp @@ -409,7 +409,11 @@ SecureTransportCertificateI::SecureTransportCertificateI(SecCertificateRef cert) { if(!_cert) { +#ifdef ICE_CPP11_MAPPING + throw invalid_argument("Invalid certificate reference"); +#else throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Invalid certificate reference"); +#endif } } diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index da4b801009c..4d58e2e2165 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -1408,7 +1408,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) }); test(false); } - catch(const IceUtil::IllegalArgumentException&) + catch(const Ice::TwowayOnlyException&) { } } @@ -1466,7 +1466,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) p->ice_oneway()->opWithResultAsync().get(); test(false); } - catch(const IceUtil::IllegalArgumentException&) + catch(const Ice::TwowayOnlyException&) { } diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp index 8846dba22e2..0024e1b740d 100644 --- a/cpp/test/Ice/binding/AllTests.cpp +++ b/cpp/test/Ice/binding/AllTests.cpp @@ -842,9 +842,6 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Ice::TwowayOnlyException&) { } - catch(const IceUtil::IllegalArgumentException&) - { - } } cout << "ok" << endl; diff --git a/cpp/test/Ice/operations/Oneways.cpp b/cpp/test/Ice/operations/Oneways.cpp index 693cbf68755..474d38ca3b8 100644 --- a/cpp/test/Ice/operations/Oneways.cpp +++ b/cpp/test/Ice/operations/Oneways.cpp @@ -28,11 +28,7 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_isA("dummy"); test(false); } -#ifdef ICE_CPP11_MAPPING - catch(const IceUtil::IllegalArgumentException&) -#else catch(const Ice::TwowayOnlyException&) -#endif { } } @@ -43,11 +39,7 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_id(); test(false); } -#ifdef ICE_CPP11_MAPPING - catch(const IceUtil::IllegalArgumentException&) -#else catch(const Ice::TwowayOnlyException&) -#endif { } } @@ -58,11 +50,7 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_ids(); test(false); } -#ifdef ICE_CPP11_MAPPING - catch(const IceUtil::IllegalArgumentException&) -#else catch(const Ice::TwowayOnlyException&) -#endif { } } @@ -87,11 +75,7 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); test(false); } -#ifdef ICE_CPP11_MAPPING - catch(const IceUtil::IllegalArgumentException&) -#else catch(const Ice::TwowayOnlyException&) -#endif { } } diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index 681f55ac74b..a067c6f2d8d 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -120,7 +120,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) #endif test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -139,7 +143,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) #endif test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -157,7 +165,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) #endif test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -239,7 +251,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) #endif test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -271,7 +287,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_isAAsync(Test::MyClass::ice_staticId()); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -282,7 +302,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_idAsync(); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } @@ -293,7 +317,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) p->ice_idsAsync(); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const Ice::TwowayOnlyException&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } } diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index d3785ad6eef..8c04095bc86 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -600,7 +600,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_timeout(0); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } @@ -608,7 +612,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { base->ice_timeout(-1); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { test(false); } @@ -618,7 +626,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_timeout(-2); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } @@ -627,7 +639,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_invocationTimeout(0); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } @@ -636,7 +652,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_invocationTimeout(-1); base->ice_invocationTimeout(-2); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { test(false); } @@ -646,7 +666,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_invocationTimeout(-3); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } @@ -654,7 +678,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { base->ice_locatorCacheTimeout(0); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { test(false); } @@ -663,7 +691,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { base->ice_locatorCacheTimeout(-1); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { test(false); } @@ -673,7 +705,11 @@ allTests(const Ice::CommunicatorPtr& communicator) base->ice_locatorCacheTimeout(-2); test(false); } +#ifdef ICE_CPP11_MAPPING + catch(const invalid_argument&) +#else catch(const IceUtil::IllegalArgumentException&) +#endif { } |