diff options
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index e3a1a273f23..adbcaa5607c 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4147,8 +4147,22 @@ 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(__ex.ice_name());"; + out << eb; + out << eb; for(pli = outParams.begin(); pli != outParams.end(); ++pli) { writeMarshalUnmarshalCode(out, package, (*pli)->type(), fixKwd((*pli)->name()), false, iter, true, @@ -4185,17 +4199,6 @@ 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);"; |