summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-02-22 22:16:03 +0000
committerMarc Laukien <marc@zeroc.com>2003-02-22 22:16:03 +0000
commit18808c3fd9bb9050babb29141d76ccd06ece7965 (patch)
tree4b60d269d5656aa763480864d889d3dbf46aac80 /cpp
parentfixed AMD exception bug (diff)
downloadice-18808c3fd9bb9050babb29141d76ccd06ece7965.tar.bz2
ice-18808c3fd9bb9050babb29141d76ccd06ece7965.tar.xz
ice-18808c3fd9bb9050babb29141d76ccd06ece7965.zip
fixed bug with exceptions propagating from ice_response()
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES3
-rw-r--r--cpp/src/slice2cpp/Gen.cpp3
-rw-r--r--cpp/src/slice2java/Gen.cpp18
3 files changed, 18 insertions, 6 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index 1771eaa47d1..943ef3b70dc 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -20,3 +20,6 @@ Changes since version 1.0.0
- Fixed a bug with throwing exceptions in AMD calls after invoking
ice_response().
+
+- Fixed a bug with throwing exceptions in AMI from within
+ ice_response().
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 1e9688b7f6f..4da25e138b0 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3388,12 +3388,13 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
}
C << eb;
writeUnmarshalCode(C, outParams, ret);
- C << nl << "ice_response(" << args << ");";
C << eb;
C << nl << "catch(const ::Ice::Exception& __ex)";
C << sb;
C << nl << "ice_exception(__ex);";
+ C << nl << "return;";
C << eb;
+ C << nl << "ice_response(" << args << ");";
C << eb;
}
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index b3e6c47cc60..8f8fd12a662 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -3780,6 +3780,16 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
}
out << sp << nl << "protected final void __response(boolean __ok)";
out << sb;
+ for(q = outParams.begin(); q != outParams.end(); ++q)
+ {
+ string typeS = typeToString(q->first, TypeModeIn, classScope);
+ out << nl << typeS << ' ' << fixKwd(q->second) << ';';
+ }
+ if(ret)
+ {
+ string retS = typeToString(ret, TypeModeIn, classScope);
+ out << nl << retS << " __ret;";
+ }
out << nl << "try";
out << sb;
if(ret || !outParams.empty() || !throws.empty())
@@ -3840,29 +3850,27 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << eb;
for(q = outParams.begin(); q != outParams.end(); ++q)
{
- string typeS = typeToString(q->first, TypeModeIn, classScope);
- out << nl << typeS << ' ' << fixKwd(q->second) << ';';
writeMarshalUnmarshalCode(out, classScope, q->first, fixKwd(q->second), false, iter);
}
if(ret)
{
- string retS = typeToString(ret, TypeModeIn, classScope);
- out << nl << retS << " __ret;";
writeMarshalUnmarshalCode(out, classScope, ret, "__ret", false, iter);
}
- out << nl << "ice_response(" << argsAMI << ");";
out << eb;
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
out << nl << "ice_exception(__ex);";
+ out << nl << "return;";
out << eb;
if(!throws.empty())
{
out << nl << "catch(Ice.UserException __ex)";
out << sb;
out << nl << "ice_exception(__ex);";
+ out << nl << "return;";
out << eb;
}
+ out << nl << "ice_response(" << argsAMI << ");";
out << eb;
out << eb << ';';