From 8582bf17281769d6b58618018f2119f9dd520ac7 Mon Sep 17 00:00:00 2001 From: Marc Laukien Date: Mon, 16 Feb 2004 14:50:37 +0000 Subject: fixes --- cpp/src/slice2cpp/Gen.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'cpp/src/slice2cpp/Gen.cpp') diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index f28ba7ba16f..381ec7f2b4e 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1514,7 +1514,6 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) C << nl << "static const ::std::string __operation(\"" << p->name() << "\");"; C << nl << "::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, " << "static_cast< ::Ice::OperationMode>(" << p->mode() << "), __context);"; - C << nl << "::IceInternal::BasicStream* __is = __out.is();"; if(!inParams.empty()) { C << nl << "::IceInternal::BasicStream* __os = __out.os();"; @@ -1524,31 +1523,30 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) { C << nl << "__os->writePendingObjects();"; } - C << nl << "if(!__out.invoke())"; + C << nl << "bool __ok = __out.invoke();"; + C << nl << "try"; + C << sb; + C << nl << "::IceInternal::BasicStream* __is = __out.is();"; + C << nl << "if(!__ok)"; C << sb; C << nl << "__is->throwException();"; C << eb; writeAllocateCode(C, TypeStringList(), ret); - if(!outParams.empty() || ret) + writeUnmarshalCode(C, outParams, ret); + if(p->returnsClasses()) { - C << nl << "try"; - C << sb; - writeUnmarshalCode(C, outParams, ret); - if(p->returnsClasses()) - { - C << nl << "__is->readPendingObjects();"; - } - C << eb; - C << nl << "catch(const ::Ice::LocalException& __ex)"; - C << sb; - C << nl << "throw ::IceInternal::NonRepeatable(__ex);"; - C << eb; + C << nl << "__is->readPendingObjects();"; } if(ret) { C << nl << "return __ret;"; } C << eb; + C << nl << "catch(const ::Ice::LocalException& __ex)"; + C << sb; + C << nl << "throw ::IceInternal::NonRepeatable(__ex);"; + C << eb; + C << eb; } Slice::Gen::DelegateDVisitor::DelegateDVisitor(Output& h, Output& c, const string& dllExport) : @@ -3445,11 +3443,16 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) C << nl << "__is->readPendingObjects();"; } C << eb; - C << nl << "catch(const ::Ice::Exception& __ex)"; + C << nl << "catch(const ::Ice::LocalException& __ex)"; C << sb; C << nl << "__finished(__ex);"; C << nl << "return;"; C << eb; + C << nl << "catch(const ::Ice::UserException& __ex)"; + C << sb; + C << nl << "ice_exception(__ex);"; + C << nl << "return;"; + C << eb; C << nl << "ice_response" << spar << args << epar << ';'; C << eb; } -- cgit v1.2.3