summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-07-25 19:19:26 +0000
committerMark Spruiell <mes@zeroc.com>2005-07-25 19:19:26 +0000
commitce5453ccbc3bed8c06dddc60dd922d7eb82dd6b7 (patch)
treed460314d578685b68664bf951100f65efe752f90 /cpp/src
parentfix for bug 421 (diff)
downloadice-ce5453ccbc3bed8c06dddc60dd922d7eb82dd6b7.tar.bz2
ice-ce5453ccbc3bed8c06dddc60dd922d7eb82dd6b7.tar.xz
ice-ce5453ccbc3bed8c06dddc60dd922d7eb82dd6b7.zip
AMI change for UnknownUserException
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp30
-rw-r--r--cpp/src/slice2java/Gen.cpp28
2 files changed, 31 insertions, 27 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 254aa82b888..6ebb4b44bf0 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -4140,20 +4140,10 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
C << sb;
C << nl << "if(!__ok)";
C << sb;
- C << nl << "__is->throwException();";
- C << eb;
- writeUnmarshalCode(C, outParams, ret);
- if(p->returnsClasses())
- {
- C << nl << "__is->readPendingObjects();";
- }
- C << eb;
- C << nl << "catch(const ::Ice::LocalException& __ex)";
+ C << nl << "try";
C << sb;
- C << nl << "__finished(__ex);";
- C << nl << "return;";
+ C << nl << "__is->throwException();";
C << eb;
-
//
// Generate a catch block for each legal user exception.
// (See comment in DelegateMVisitor::visitOperation() for details.)
@@ -4175,9 +4165,21 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
C << nl << "return;";
C << eb;
}
- C << nl << "catch(const ::Ice::UserException&)";
+ C << nl << "catch(const ::Ice::UserException& __ex)";
C << sb;
- C << nl << "ice_exception(::Ice::UnknownUserException(__FILE__, __LINE__));";
+ C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());";
+ C << eb;
+ C << eb;
+
+ writeUnmarshalCode(C, outParams, ret);
+ if(p->returnsClasses())
+ {
+ C << nl << "__is->readPendingObjects();";
+ }
+ C << eb;
+ C << nl << "catch(const ::Ice::LocalException& __ex)";
+ C << sb;
+ C << nl << "__finished(__ex);";
C << nl << "return;";
C << eb;
C << nl << "ice_response" << spar << args << epar << ';';
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index adbcaa5607c..c45c07499be 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -4915,8 +4915,23 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << sb;
out << nl << "if(!__ok)";
out << sb;
+ out << nl << "try";
+ out << sb;
out << nl << "__is.throwException();";
out << eb;
+ for(ExceptionList::const_iterator r = throws.begin(); r != throws.end(); ++r)
+ {
+ out << nl << "catch(" << getAbsolute(*r, classPkg) << " __ex)";
+ out << sb;
+ out << nl << "ice_exception(__ex);";
+ out << nl << "return;";
+ out << eb;
+ }
+ out << nl << "catch(Ice.UserException __ex)";
+ out << sb;
+ out << nl << "throw new Ice.UnknownUserException(__ex.ice_name());";
+ out << eb;
+ out << eb;
for(pli = outParams.begin(); pli != outParams.end(); ++pli)
{
TypePtr paramType = (*pli)->type();
@@ -4949,19 +4964,6 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "__is.readPendingObjects();";
}
out << eb;
- for(ExceptionList::const_iterator r = throws.begin(); r != throws.end(); ++r)
- {
- out << nl << "catch(" << getAbsolute(*r, classPkg) << " __ex)";
- out << sb;
- out << nl << "ice_exception(__ex);";
- out << nl << "return;";
- out << eb;
- }
- out << nl << "catch(Ice.UserException __ex)";
- out << sb;
- out << nl << "__finished(new Ice.UnknownUserException(__ex.ice_name()));";
- out << nl << "return;";
- out << eb;
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
out << nl << "__finished(__ex);";