summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-07-22 22:45:01 +0000
committerMark Spruiell <mes@zeroc.com>2005-07-22 22:45:01 +0000
commit6d26797e5bcb25a77a58189e58f3645914dc1603 (patch)
tree82ba67bf1bf0c78ba61282d305d958eefd2296a5 /cpp/src/slice2java/Gen.cpp
parentfix for bug 421 (diff)
downloadice-6d26797e5bcb25a77a58189e58f3645914dc1603.tar.bz2
ice-6d26797e5bcb25a77a58189e58f3645914dc1603.tar.xz
ice-6d26797e5bcb25a77a58189e58f3645914dc1603.zip
do not retry on UnknownUserException
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp58
1 files changed, 23 insertions, 35 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 739e4e8b65a..e3a1a273f23 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -4147,21 +4147,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "IceInternal.BasicStream __is = __og.is();";
out << nl << "if(!__ok)";
out << sb;
- out << nl << "try";
- out << sb;
out << nl << "__is.throwException();";
- out << eb;
- for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t)
- {
- out << nl << "catch(" << getAbsolute(*t, package) << " __ex)";
- out << sb;
- out << nl << "throw __ex;";
- out << eb;
- }
- out << nl << "catch(Ice.UserException __ex)";
- out << sb;
- out << nl << "throw new Ice.UnknownUserException();";
- out << eb;
out << eb;
for(pli = outParams.begin(); pli != outParams.end(); ++pli)
{
@@ -4199,6 +4185,17 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
}
}
out << eb;
+ for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t)
+ {
+ out << nl << "catch(" << getAbsolute(*t, package) << " __ex)";
+ out << sb;
+ out << nl << "throw __ex;";
+ out << eb;
+ }
+ out << nl << "catch(Ice.UserException __ex)";
+ out << sb;
+ out << nl << "throw new Ice.UnknownUserException(__ex.ice_name());";
+ out << eb;
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
out << nl << "throw new IceInternal.NonRepeatable(__ex);";
@@ -4915,22 +4912,8 @@ 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 << "throw __ex;";
- out << eb;
- }
- out << nl << "catch(Ice.UserException __ex)";
- out << sb;
- out << nl << "throw new Ice.UnknownUserException();";
- out << eb;
- out << eb;
for(pli = outParams.begin(); pli != outParams.end(); ++pli)
{
TypePtr paramType = (*pli)->type();
@@ -4963,19 +4946,24 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "__is.readPendingObjects();";
}
out << eb;
- out << nl << "catch(Ice.LocalException __ex)";
- out << sb;
- out << nl << "__finished(__ex);";
- out << nl << "return;";
- out << eb;
- if(!throws.empty())
+ for(ExceptionList::const_iterator r = throws.begin(); r != throws.end(); ++r)
{
- out << nl << "catch(Ice.UserException __ex)";
+ 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);";
+ out << nl << "return;";
+ out << eb;
out << nl << "ice_response" << spar << args << epar << ';';
out << eb;
out << eb;