diff options
Diffstat (limited to 'cpp/src/slice2cppe')
-rw-r--r-- | cpp/src/slice2cppe/Gen.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index bb10821b28b..63a30074209 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -1478,15 +1478,10 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) C << nl << "::IceInternal::BasicStream* __is = __out.is();"; C << nl << "if(!__ok)"; C << sb; + C << nl << "try"; + C << sb; C << nl << "__is->throwException();"; C << eb; - writeAllocateCode(C, TypeStringList(), ret); - writeUnmarshalCode(C, outParams, ret); - if(ret) - { - C << nl << "return __ret;"; - } - C << eb; // // Generate a catch block for each legal user exception. This is necessary @@ -1527,10 +1522,22 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) C << nl << "throw;"; C << eb; } - C << nl << "catch(const ::Ice::UserException&)"; + C << nl << "catch(const ::Ice::UserException& __ex)"; C << sb; - C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__);"; + C << nl << "::Ice::UnknownUserException __uex(__FILE__, __LINE__);"; + C << nl << "__uex.unknown = __ex.ice_name();"; + C << nl << "throw __uex;"; + C << eb; C << eb; + + writeAllocateCode(C, TypeStringList(), ret); + writeUnmarshalCode(C, outParams, ret); + if(ret) + { + C << nl << "return __ret;"; + } + C << eb; + C << nl << "catch(const ::Ice::LocalException& __ex)"; C << sb; C << nl << "throw ::IceInternal::NonRepeatable(__ex);"; |