summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2003-01-25 02:58:50 +0000
committerMark Spruiell <mes@zeroc.com>2003-01-25 02:58:50 +0000
commit3d6af2bc56a33b482a938dc3e71ebfb87d2095a7 (patch)
tree565e2f0e432894d45cfbcb071a1e152122817f98
parentoperator* (diff)
downloadice-3d6af2bc56a33b482a938dc3e71ebfb87d2095a7.tar.bz2
ice-3d6af2bc56a33b482a938dc3e71ebfb87d2095a7.tar.xz
ice-3d6af2bc56a33b482a938dc3e71ebfb87d2095a7.zip
raise NonRepeatable when exception occurs during reply unmarshalling
-rw-r--r--cpp/src/slice2cpp/Gen.cpp12
-rw-r--r--cpp/src/slice2java/Gen.cpp13
2 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 091264cd4fa..5c6a86c7b44 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1706,7 +1706,17 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
}
C << eb;
writeAllocateCode(C, TypeStringList(), ret);
- writeUnmarshalCode(C, outParams, ret);
+ if(!outParams.empty() || ret)
+ {
+ C << nl << "try";
+ C << sb;
+ writeUnmarshalCode(C, outParams, ret);
+ C << eb;
+ C << nl << "catch(const ::Ice::LocalException& __ex)";
+ C << sb;
+ C << nl << "throw ::IceInternal::NonRepeatable(__ex);";
+ C << eb;
+ }
if(ret)
{
C << nl << "return __ret;";
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 13938c10b9a..3b0de1f5437 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -3109,6 +3109,11 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
}
out << nl << "throw new Ice.UnknownUserException();";
out << eb;
+ if(!outParams.empty() || ret)
+ {
+ out << nl << "try";
+ out << sb;
+ }
for(q = outParams.begin(); q != outParams.end(); ++q)
{
writeMarshalUnmarshalCode(out, scope, q->first, fixKwd(q->second), false, iter, true);
@@ -3119,6 +3124,14 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
writeMarshalUnmarshalCode(out, scope, ret, "__ret", false, iter);
out << nl << "return __ret;";
}
+ if(!outParams.empty() || ret)
+ {
+ out << eb;
+ out << nl << "catch(Ice.LocalException __ex)";
+ out << sb;
+ out << nl << "throw new IceInternal.NonRepeatable(__ex);";
+ out << eb;
+ }
out << eb;
out << nl << "finally";
out << sb;