summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/Exception.h5
-rw-r--r--cpp/src/Ice/Exception.cpp2
-rwxr-xr-xcpp/src/slice2cpp/Gen.cpp4
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp31
-rw-r--r--cpp/src/slice2java/Gen.cpp30
5 files changed, 31 insertions, 41 deletions
diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h
index cf2b944d2d3..74e33d152c9 100644
--- a/cpp/include/Ice/Exception.h
+++ b/cpp/include/Ice/Exception.h
@@ -62,12 +62,15 @@ public:
typedef ::IceInternal::Handle<UserException> UserExceptionPtr;
-class ICE_API SystemException : public LocalException
+class ICE_API SystemException : public IceUtil::Exception
{
public:
SystemException(const char*, int);
virtual ~SystemException() throw();
+ virtual std::string ice_name() const = 0;
+ virtual Exception* ice_clone() const = 0;
+ virtual void ice_throw() const = 0;
};
typedef ::IceInternal::Handle<SystemException> SystemExceptionPtr;
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index c147357e62c..c930fca7b7e 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -53,7 +53,7 @@ Ice::LocalException::~LocalException() throw()
}
Ice::SystemException::SystemException(const char* file, int line) :
- LocalException(file, line)
+ Exception(file, line)
{
}
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 65fd5a08e58..dbc34fc94f7 100755
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3026,6 +3026,10 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p)
C << nl << "throw;";
C << eb;
}
+ C << nl << "catch(const ::Ice::SystemException&)";
+ C << sb;
+ C << nl << "throw;";
+ C << eb;
C << nl << "catch(const ::IceInternal::LocalExceptionWrapper&)";
C << sb;
C << nl << "throw;";
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index dc23423563c..1192172a13e 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -4150,6 +4150,9 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << sb;
_out << nl << "direct__ = new IceInternal.Direct(current__, run__);";
+ _out << nl << "try";
+ _out << sb;
+
_out << nl << "Ice.DispatchStatus status__ = direct__.servant().collocDispatch__(direct__);";
if(!throws.empty())
{
@@ -4161,6 +4164,12 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "_System.Diagnostics.Debug.Assert(status__ == Ice.DispatchStatus.DispatchOK);";
_out << eb;
+ _out << nl << "finally";
+ _out << sb;
+ _out << nl << "direct__.destroy();";
+ _out << eb;
+ _out << eb;
+
for(ExceptionList::const_iterator i = throws.begin(); i != throws.end(); ++i)
{
_out << nl << "catch(" << fixId((*i)->scoped()) << ')';
@@ -4168,31 +4177,15 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "throw;";
_out << eb;
}
- _out << nl << "catch(System.Exception ex__)";
- _out << sb;
- _out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);";
- _out << eb;
- _out << nl << "finally";
- _out << sb;
- _out << nl << "if(direct__ != null)";
- _out << sb;
- _out << nl << "try";
+ _out << nl << "catch(Ice.SystemException)";
_out << sb;
- _out << nl << "direct__.destroy();";
+ _out << nl << "throw;";
_out << eb;
- for(ExceptionList::const_iterator j = throws.begin(); j != throws.end(); ++j)
- {
- _out << nl << "catch(" << fixId((*j)->scoped()) << " ex__)";
- _out << sb;
- _out << nl << "throw ex__;";
- _out << eb;
- }
_out << nl << "catch(System.Exception ex__)";
_out << sb;
_out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);";
_out << eb;
- _out << eb;
- _out << eb;
+
//
//
// Set out parameters
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index dd285b1db1c..37fe9a2d6d8 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -4392,6 +4392,8 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
out << eb;
out << ";";
+ out << nl << "try";
+ out << sb;
out << sp << nl << "Ice.DispatchStatus __status = __direct.servant().__collocDispatch(__direct);";
out << nl << "if(__status == Ice.DispatchStatus.DispatchUserException)";
out << sb;
@@ -4404,6 +4406,12 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
}
out << eb;
+ out << nl << "finally";
+ out << sb;
+ out << nl << "__direct.destroy();";
+ out << eb;
+
+ out << eb;
for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t)
{
string exS = getAbsolute(*t, package);
@@ -4413,33 +4421,15 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
out << eb;
}
- out << nl << "catch(java.lang.Throwable __ex)";
+ out << nl << "catch(Ice.SystemException __ex)";
out << sb;
- out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);";
+ out << nl << "throw __ex;";
out << eb;
- out << nl << "finally";
- out << sb;
- out << nl << "if(__direct != null)";
- out << sb;
- out << nl << "try";
- out << sb;
- out << nl << "__direct.destroy();";
- out << eb;
- for(ExceptionList::const_iterator k = throws.begin(); k != throws.end(); ++k)
- {
- string exS = getAbsolute(*k, package);
- out << nl << "catch(" << exS << " __ex)";
- out << sb;
- out << nl << "throw __ex;";
- out << eb;
- }
out << nl << "catch(java.lang.Throwable __ex)";
out << sb;
out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);";
out << eb;
- out << eb;
- out << eb;
}
if(ret && !cl->hasMetaData("amd") && !op->hasMetaData("amd"))
{