summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Reference.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-01-08 21:10:14 +0100
committerJose <jose@zeroc.com>2016-01-08 21:10:14 +0100
commit93ab5a8f08970ad49c6f973b965b8fbefb63882f (patch)
tree18c00abdc514ca90a7ab6e1acc5b350847843681 /cpp/src/Ice/Reference.cpp
parentC++98 test minor build fix (diff)
downloadice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.bz2
ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.xz
ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.zip
C++11 fix Exception::ice_clone to use exception_ptr
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index e2b36e92ffa..bc635c8e0a9 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -1773,6 +1773,25 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
virtual void
setException(const Ice::LocalException& ex)
{
+#ifdef ICE_CPP11_MAPPING
+ if(!_exception)
+ {
+ _exception = ex.ice_clone();
+ }
+
+ try
+ {
+ rethrow_exception(_exception);
+ }
+ catch(const Ice::LocalException& ee)
+ {
+ if(++_i == _endpoints.size())
+ {
+ _callback->setException(ee);
+ return;
+ }
+ }
+#else
if(!_exception.get())
{
_exception.reset(ex.ice_clone());
@@ -1783,7 +1802,7 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
_callback->setException(*_exception.get());
return;
}
-
+#endif
const bool more = _i != _endpoints.size() - 1;
vector<EndpointIPtr> endpoint;
endpoint.push_back(_endpoints[_i]);
@@ -1807,7 +1826,11 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
const vector<EndpointIPtr> _endpoints;
const GetConnectionCallbackPtr _callback;
size_t _i;
+#ifdef ICE_CPP11_MAPPING
+ std::exception_ptr _exception;
+#else
IceUtil::UniquePtr<Ice::LocalException> _exception;
+#endif
};
//