diff options
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
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);"; |