Skip to content

Commit

Permalink
HEAD:(zeroc-ice/ice@fd47c71ac1) Remove system exception (zeroc-ice/ic…
Browse files Browse the repository at this point in the history
bernardnormier authored and temp committed May 14, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
yrodiere Yoann Rodière
1 parent d62b007 commit 9422e55
Showing 1,723 changed files with 2,378 additions and 4,471 deletions.
12 changes: 6 additions & 6 deletions slice2cpp/cpp/src/IceGrid/Internal.cpp
Original file line number Diff line number Diff line change
@@ -1589,11 +1589,11 @@ IceGrid::ReplicaSessionPrx::_iceI_setAdapterDirectProxy(const ::std::shared_ptr<
{
ex.ice_throw();
}
catch(const AdapterNotExistException&)
catch(const AdapterExistsException&)
{
throw;
}
catch(const AdapterExistsException&)
catch(const AdapterNotExistException&)
{
throw;
}
@@ -1705,11 +1705,11 @@ IceGrid::InternalRegistryPrx::_iceI_registerNode(const ::std::shared_ptr<::IceIn
{
ex.ice_throw();
}
catch(const PermissionDeniedException&)
catch(const NodeActiveException&)
{
throw;
}
catch(const NodeActiveException&)
catch(const PermissionDeniedException&)
{
throw;
}
@@ -1755,11 +1755,11 @@ IceGrid::InternalRegistryPrx::_iceI_registerReplica(const ::std::shared_ptr<::Ic
{
ex.ice_throw();
}
catch(const PermissionDeniedException&)
catch(const ReplicaActiveException&)
{
throw;
}
catch(const ReplicaActiveException&)
catch(const PermissionDeniedException&)
{
throw;
}
50 changes: 3 additions & 47 deletions slice2cpp/csharp/test/Ice/retry/Test.cpp
Original file line number Diff line number Diff line change
@@ -124,34 +124,6 @@ Test::RetryPrx::_iceI_opNotIdempotent(const ::std::shared_ptr<::IceInternal::Out
nullptr);
}

void
Test::RetryPrx::opSystemException(const ::Ice::Context& context) const
{
::IceInternal::makePromiseOutgoing<void>(true, this, &RetryPrx::_iceI_opSystemException, context).get();
}

::std::future<void>
Test::RetryPrx::opSystemExceptionAsync(const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<void>(false, this, &RetryPrx::_iceI_opSystemException, context);
}

::std::function<void()>
Test::RetryPrx::opSystemExceptionAsync(::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent, const ::Ice::Context& context) const
{
return ::IceInternal::makeLambdaOutgoing<void>(::std::move(response), ::std::move(ex), ::std::move(sent), this, &Test::RetryPrx::_iceI_opSystemException, context);
}

void
Test::RetryPrx::_iceI_opSystemException(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::Ice::Context& context) const
{
static constexpr ::std::string_view operationName = "opSystemException";

outAsync->invoke(operationName, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
nullptr,
nullptr);
}

void
Test::RetryPrx::sleep(::std::int32_t iceP_delay, const ::Ice::Context& context) const
{
@@ -283,17 +255,6 @@ Test::Retry::_iceD_opNotIdempotent(::Ice::IncomingRequest& request, ::std::funct
}
/// \endcond

/// \cond INTERNAL
void
Test::Retry::_iceD_opSystemException(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
{
_iceCheckMode(::Ice::OperationMode::Normal, request.current().mode);
request.inputStream().skipEmptyEncapsulation();
this->opSystemException(request.current());
sendResponse(::Ice::makeEmptyOutgoingResponse(request.current()));
}
/// \endcond

/// \cond INTERNAL
void
Test::Retry::_iceD_sleep(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
@@ -324,10 +285,10 @@ Test::Retry::_iceD_shutdown(::Ice::IncomingRequest& request, ::std::function<voi
void
Test::Retry::dispatch(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
{
static constexpr ::std::string_view allOperations[] = {"ice_id", "ice_ids", "ice_isA", "ice_ping", "op", "opIdempotent", "opNotIdempotent", "opSystemException", "shutdown", "sleep"};
static constexpr ::std::string_view allOperations[] = {"ice_id", "ice_ids", "ice_isA", "ice_ping", "op", "opIdempotent", "opNotIdempotent", "shutdown", "sleep"};

const ::Ice::Current& current = request.current();
::std::pair<const ::std::string_view*, const ::std::string_view*> r = ::std::equal_range(allOperations, allOperations + 10, current.operation);
::std::pair<const ::std::string_view*, const ::std::string_view*> r = ::std::equal_range(allOperations, allOperations + 9, current.operation);
if(r.first == r.second)
{
sendResponse(::Ice::makeOutgoingResponse(::std::make_exception_ptr(::Ice::OperationNotExistException(__FILE__, __LINE__)), current));
@@ -372,16 +333,11 @@ Test::Retry::dispatch(::Ice::IncomingRequest& request, ::std::function<void(::Ic
break;
}
case 7:
{
_iceD_opSystemException(request, ::std::move(sendResponse));
break;
}
case 8:
{
_iceD_shutdown(request, ::std::move(sendResponse));
break;
}
case 9:
case 8:
{
_iceD_sleep(request, ::std::move(sendResponse));
break;
16 changes: 0 additions & 16 deletions slice2cpp/csharp/test/Ice/retry/Test.h
Original file line number Diff line number Diff line change
@@ -71,17 +71,6 @@ class RetryPrx : public ::Ice::Proxy<RetryPrx, ::Ice::ObjectPrx>
void _iceI_opNotIdempotent(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>&, const ::Ice::Context&) const;
/// \endcond

void opSystemException(const ::Ice::Context& context = ::Ice::noExplicitContext) const;

::std::future<void> opSystemExceptionAsync(const ::Ice::Context& context = ::Ice::noExplicitContext) const;

::std::function<void()>
opSystemExceptionAsync(::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex = nullptr, ::std::function<void(bool)> sent = nullptr, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// \cond INTERNAL
void _iceI_opSystemException(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>&, const ::Ice::Context&) const;
/// \endcond

void sleep(::std::int32_t delay, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

::std::future<void> sleepAsync(::std::int32_t delay, const ::Ice::Context& context = ::Ice::noExplicitContext) const;
@@ -198,11 +187,6 @@ class Retry : public virtual ::Ice::Object
void _iceD_opNotIdempotent(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
/// \endcond

virtual void opSystemException(const ::Ice::Current& current) = 0;
/// \cond INTERNAL
void _iceD_opSystemException(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
/// \endcond

virtual void sleep(::std::int32_t delay, const ::Ice::Current& current) = 0;
/// \cond INTERNAL
void _iceD_sleep(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
141 changes: 8 additions & 133 deletions slice2cpp/java/test/src/main/java/test/Ice/interceptor/Test.cpp
Original file line number Diff line number Diff line change
@@ -180,38 +180,6 @@ Test::MyObjectPrx::_iceI_notExistAdd(const ::std::shared_ptr<::IceInternal::Outg
nullptr);
}

::std::int32_t
Test::MyObjectPrx::badSystemAdd(::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<::std::int32_t>(true, this, &MyObjectPrx::_iceI_badSystemAdd, iceP_x, iceP_y, context).get();
}

::std::future<::std::int32_t>
Test::MyObjectPrx::badSystemAddAsync(::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<::std::int32_t>(false, this, &MyObjectPrx::_iceI_badSystemAdd, iceP_x, iceP_y, context);
}

::std::function<void()>
Test::MyObjectPrx::badSystemAddAsync(::std::int32_t iceP_x, ::std::int32_t iceP_y, ::std::function<void(::std::int32_t)> response, ::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent, const ::Ice::Context& context) const
{
return ::IceInternal::makeLambdaOutgoing<::std::int32_t>(::std::move(response), ::std::move(ex), ::std::move(sent), this, &Test::MyObjectPrx::_iceI_badSystemAdd, iceP_x, iceP_y, context);
}

void
Test::MyObjectPrx::_iceI_badSystemAdd(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::std::int32_t>>& outAsync, ::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
static constexpr ::std::string_view operationName = "badSystemAdd";

_checkTwowayOnly(operationName);
outAsync->invoke(operationName, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
[&](::Ice::OutputStream* ostr)
{
ostr->writeAll(iceP_x, iceP_y);
},
nullptr);
}

::std::int32_t
Test::MyObjectPrx::amdAdd(::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
@@ -353,38 +321,6 @@ Test::MyObjectPrx::_iceI_amdNotExistAdd(const ::std::shared_ptr<::IceInternal::O
nullptr);
}

::std::int32_t
Test::MyObjectPrx::amdBadSystemAdd(::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<::std::int32_t>(true, this, &MyObjectPrx::_iceI_amdBadSystemAdd, iceP_x, iceP_y, context).get();
}

::std::future<::std::int32_t>
Test::MyObjectPrx::amdBadSystemAddAsync(::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<::std::int32_t>(false, this, &MyObjectPrx::_iceI_amdBadSystemAdd, iceP_x, iceP_y, context);
}

::std::function<void()>
Test::MyObjectPrx::amdBadSystemAddAsync(::std::int32_t iceP_x, ::std::int32_t iceP_y, ::std::function<void(::std::int32_t)> response, ::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent, const ::Ice::Context& context) const
{
return ::IceInternal::makeLambdaOutgoing<::std::int32_t>(::std::move(response), ::std::move(ex), ::std::move(sent), this, &Test::MyObjectPrx::_iceI_amdBadSystemAdd, iceP_x, iceP_y, context);
}

void
Test::MyObjectPrx::_iceI_amdBadSystemAdd(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::std::int32_t>>& outAsync, ::std::int32_t iceP_x, ::std::int32_t iceP_y, const ::Ice::Context& context) const
{
static constexpr ::std::string_view operationName = "amdBadSystemAdd";

_checkTwowayOnly(operationName);
outAsync->invoke(operationName, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
[&](::Ice::OutputStream* ostr)
{
ostr->writeAll(iceP_x, iceP_y);
},
nullptr);
}

::std::string_view
Test::MyObjectPrx::ice_staticId() noexcept
{
@@ -527,26 +463,6 @@ Test::MyObject::_iceD_notExistAdd(::Ice::IncomingRequest& request, ::std::functi
}
/// \endcond

/// \cond INTERNAL
void
Test::MyObject::_iceD_badSystemAdd(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
{
_iceCheckMode(::Ice::OperationMode::Normal, request.current().mode);
auto istr = &request.inputStream();
istr->startEncapsulation();
::std::int32_t iceP_x;
::std::int32_t iceP_y;
istr->readAll(iceP_x, iceP_y);
istr->endEncapsulation();
::std::int32_t ret = this->badSystemAdd(iceP_x, iceP_y, request.current());
sendResponse(::Ice::makeOutgoingResponse([&](::Ice::OutputStream* ostr)
{
ostr->writeAll(ret);
},
request.current()));
}
/// \endcond

/// \cond INTERNAL
void
Test::MyObject::_iceD_amdAdd(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
@@ -671,45 +587,14 @@ Test::MyObject::_iceD_amdNotExistAdd(::Ice::IncomingRequest& request, ::std::fun
}
/// \endcond

/// \cond INTERNAL
void
Test::MyObject::_iceD_amdBadSystemAdd(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
{
_iceCheckMode(::Ice::OperationMode::Normal, request.current().mode);
auto istr = &request.inputStream();
istr->startEncapsulation();
::std::int32_t iceP_x;
::std::int32_t iceP_y;
istr->readAll(iceP_x, iceP_y);
istr->endEncapsulation();
auto responseHandler = ::std::make_shared<::IceInternal::AsyncResponseHandler>(::std::move(sendResponse), request.current());
auto responseCb = [responseHandler](::std::int32_t ret)
{
responseHandler->sendResponse(
[&](::Ice::OutputStream* ostr)
{
ostr->writeAll(ret);
});
};
try
{
this->amdBadSystemAddAsync(iceP_x, iceP_y, ::std::move(responseCb), [responseHandler](std::exception_ptr ex) { responseHandler->sendException(ex); }, responseHandler->current());
}
catch (...)
{
responseHandler->sendException(::std::current_exception());
}
}
/// \endcond

/// \cond INTERNAL
void
Test::MyObject::dispatch(::Ice::IncomingRequest& request, ::std::function<void(::Ice::OutgoingResponse)> sendResponse)
{
static constexpr ::std::string_view allOperations[] = {"add", "addWithRetry", "amdAdd", "amdAddWithRetry", "amdBadAdd", "amdBadSystemAdd", "amdNotExistAdd", "badAdd", "badSystemAdd", "ice_id", "ice_ids", "ice_isA", "ice_ping", "notExistAdd"};
static constexpr ::std::string_view allOperations[] = {"add", "addWithRetry", "amdAdd", "amdAddWithRetry", "amdBadAdd", "amdNotExistAdd", "badAdd", "ice_id", "ice_ids", "ice_isA", "ice_ping", "notExistAdd"};

const ::Ice::Current& current = request.current();
::std::pair<const ::std::string_view*, const ::std::string_view*> r = ::std::equal_range(allOperations, allOperations + 14, current.operation);
::std::pair<const ::std::string_view*, const ::std::string_view*> r = ::std::equal_range(allOperations, allOperations + 12, current.operation);
if(r.first == r.second)
{
sendResponse(::Ice::makeOutgoingResponse(::std::make_exception_ptr(::Ice::OperationNotExistException(__FILE__, __LINE__)), current));
@@ -744,46 +629,36 @@ Test::MyObject::dispatch(::Ice::IncomingRequest& request, ::std::function<void(:
break;
}
case 5:
{
_iceD_amdBadSystemAdd(request, ::std::move(sendResponse));
break;
}
case 6:
{
_iceD_amdNotExistAdd(request, ::std::move(sendResponse));
break;
}
case 7:
case 6:
{
_iceD_badAdd(request, ::std::move(sendResponse));
break;
}
case 8:
{
_iceD_badSystemAdd(request, ::std::move(sendResponse));
break;
}
case 9:
case 7:
{
_iceD_ice_id(request, ::std::move(sendResponse));
break;
}
case 10:
case 8:
{
_iceD_ice_ids(request, ::std::move(sendResponse));
break;
}
case 11:
case 9:
{
_iceD_ice_isA(request, ::std::move(sendResponse));
break;
}
case 12:
case 10:
{
_iceD_ice_ping(request, ::std::move(sendResponse));
break;
}
case 13:
case 11:
{
_iceD_notExistAdd(request, ::std::move(sendResponse));
break;
Loading

0 comments on commit 9422e55

Please sign in to comment.