diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-07-25 16:26:46 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-07-25 16:26:46 +0000 |
commit | e30644c12cff30ad87a37da5cf2ce3f6a9b67461 (patch) | |
tree | 4f6b59510a0bf73cb2480cd08a62bd70a3b0064e /cpp/src/slice2cppe/Gen.cpp | |
parent | fix for bug 421 (diff) | |
download | ice-e30644c12cff30ad87a37da5cf2ce3f6a9b67461.tar.bz2 ice-e30644c12cff30ad87a37da5cf2ce3f6a9b67461.tar.xz ice-e30644c12cff30ad87a37da5cf2ce3f6a9b67461.zip |
another fix for UnknownUserException
Diffstat (limited to 'cpp/src/slice2cppe/Gen.cpp')
-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);"; |