Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove system exceptions #1917

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions cpp/include/Ice/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,38 +79,6 @@ namespace Ice
virtual void _readImpl(::Ice::InputStream*) {}
/// \endcond
};

/**
* Base class for all Ice system exceptions.
*
* System exceptions are currently Ice internal, non-documented
* exceptions.
* \headerfile Ice/Ice.h
*/
class ICE_API SystemException : public IceUtil::Exception
{
public:
/**
* The file and line number are required for all local exceptions.
* @param file The file name in which the exception was raised, typically __FILE__.
* @param line The line number at which the exception was raised, typically __LINE__.
*/
SystemException(const char* file, int line);
SystemException(const SystemException&) = default;
virtual ~SystemException();

/**
* Polymorphically clones this exception.
* @return A shallow copy of this exception.
*/
std::unique_ptr<SystemException> ice_clone() const;

/**
* Obtains the Slice type ID of this exception.
* @return The fully-scoped type ID.
*/
static std::string_view ice_staticId();
};
}

namespace IceInternal
Expand Down
8 changes: 0 additions & 8 deletions cpp/src/Ice/CollocatedRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,6 @@ CollocatedRequestHandler::sendNoResponse()
_adapter->decDirectCount();
}

bool
CollocatedRequestHandler::systemException(int32_t requestId, exception_ptr ex, bool amd)
{
handleException(requestId, ex, amd);
_adapter->decDirectCount();
return true;
}

void
CollocatedRequestHandler::invokeException(int32_t requestId, exception_ptr ex, int /*invokeNum*/, bool amd)
{
Expand Down
1 change: 0 additions & 1 deletion cpp/src/Ice/CollocatedRequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace IceInternal

virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool);
virtual void sendNoResponse();
virtual bool systemException(std::int32_t, std::exception_ptr, bool);
virtual void invokeException(std::int32_t, std::exception_ptr, int, bool);

virtual Ice::ConnectionIPtr getConnection();
Expand Down
6 changes: 0 additions & 6 deletions cpp/src/Ice/ConnectionI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,12 +1169,6 @@ Ice::ConnectionI::sendNoResponse()
}
}

bool
Ice::ConnectionI::systemException(int32_t, std::exception_ptr, bool /*amd*/)
{
return false; // System exceptions aren't marshalled.
}

void
Ice::ConnectionI::invokeException(int32_t, exception_ptr ex, int invokeNum, bool /*amd*/)
{
Expand Down
1 change: 0 additions & 1 deletion cpp/src/Ice/ConnectionI.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ namespace Ice

virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool);
virtual void sendNoResponse();
virtual bool systemException(std::int32_t, std::exception_ptr, bool);
virtual void invokeException(std::int32_t, std::exception_ptr, int, bool);

IceInternal::EndpointIPtr endpoint() const;
Expand Down
21 changes: 0 additions & 21 deletions cpp/src/Ice/Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,6 @@ Ice::LocalException::ice_staticId()
return localException_ids[0];
}

Ice::SystemException::SystemException(const char* file, int line) : Exception(file, line) {}

Ice::SystemException::~SystemException() {}

unique_ptr<Ice::SystemException>
Ice::SystemException::ice_clone() const
{
return unique_ptr<SystemException>(static_cast<SystemException*>(ice_cloneImpl()));
}

namespace
{
const string systemException_ids[] = {"::Ice::SystemException"};
}

std::string_view
Ice::SystemException::ice_staticId()
{
return systemException_ids[0];
}

void
Ice::InitializationException::ice_print(ostream& out) const
{
Expand Down
9 changes: 0 additions & 9 deletions cpp/src/Ice/Incoming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,6 @@ Incoming::handleException(std::exception_ptr exc, bool amd)
}
catch (const Exception& ex)
{
if (dynamic_cast<const SystemException*>(&ex))
{
if (_responseHandler->systemException(_current.requestId, exc, amd))
{
return;
}
// else, keep going
}

if (_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
{
warning(ex);
Expand Down
1 change: 0 additions & 1 deletion cpp/src/Ice/ResponseHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace IceInternal
public:
virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool) = 0;
virtual void sendNoResponse() = 0;
virtual bool systemException(std::int32_t, std::exception_ptr, bool) = 0;
virtual void invokeException(std::int32_t, std::exception_ptr, int, bool) = 0;
};
}
Expand Down
30 changes: 0 additions & 30 deletions cpp/test/Ice/retry/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <TestHelper.h>
#include <Test.h>
#include <InstrumentationI.h>
#include <SystemFailure.h>

using namespace std;
using namespace Test;
Expand Down Expand Up @@ -221,35 +220,6 @@ allTests(const Ice::CommunicatorPtr& communicator, const Ice::CommunicatorPtr& c
testRetryCount(0);
cout << "ok" << endl;

if (!retry1->ice_getConnection())
{
testInvocationCount(-1);
cout << "testing system exception... " << flush;
try
{
retry1->opSystemException();
test(false);
}
catch (const SystemFailure&)
{
}
testInvocationCount(1);
testFailureCount(1);
testRetryCount(0);
try
{
retry1->opSystemExceptionAsync().get();
test(false);
}
catch (const SystemFailure&)
{
}
testInvocationCount(1);
testFailureCount(1);
testRetryCount(0);
cout << "ok" << endl;
}

{
cout << "testing invocation timeout and retries... " << flush;
retry2 = RetryPrx(communicator2, retry1->ice_toString());
Expand Down
24 changes: 0 additions & 24 deletions cpp/test/Ice/retry/SystemFailure.h

This file was deleted.

1 change: 0 additions & 1 deletion cpp/test/Ice/retry/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface Retry

idempotent int opIdempotent(int c);
void opNotIdempotent();
void opSystemException();

idempotent void sleep(int delay);

Expand Down
7 changes: 0 additions & 7 deletions cpp/test/Ice/retry/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <Ice/Ice.h>

#include <TestI.h>
#include <SystemFailure.h>

#include <thread>
using namespace std;
Expand Down Expand Up @@ -53,12 +52,6 @@ RetryI::opNotIdempotent(const Ice::Current&)
throw Ice::ConnectionLostException(__FILE__, __LINE__);
}

void
RetryI::opSystemException(const Ice::Current&)
{
throw SystemFailure(__FILE__, __LINE__);
}

void
RetryI::sleep(int delay, const Ice::Current&)
{
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Ice/retry/TestI.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class RetryI : public Test::Retry
virtual void op(bool, const Ice::Current&);
virtual int opIdempotent(int, const Ice::Current&);
virtual void opNotIdempotent(const Ice::Current&);
virtual void opSystemException(const Ice::Current&);
virtual void sleep(int, const Ice::Current&);
virtual void shutdown(const Ice::Current&);

Expand Down
Loading