diff options
author | Michi Henning <michi@zeroc.com> | 2007-11-21 16:37:35 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-11-21 16:37:35 +1000 |
commit | a383113f0becaa15b7e047798aa57026133f9077 (patch) | |
tree | db198efbd739eb6b6b3864c4fdbc0385e4f326be /cpp/src | |
parent | Fix a problem where protocol selection and other runtime flags were (diff) | |
download | ice-a383113f0becaa15b7e047798aa57026133f9077.tar.bz2 ice-a383113f0becaa15b7e047798aa57026133f9077.tar.xz ice-a383113f0becaa15b7e047798aa57026133f9077.zip |
Bug 2541.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Freeze/TransactionalEvictorContext.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 16 | ||||
-rw-r--r-- | cpp/src/Ice/Outgoing.cpp | 18 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 16 | ||||
-rwxr-xr-x | cpp/src/slice2cpp/Gen.cpp | 4 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 4 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 23 |
7 files changed, 36 insertions, 47 deletions
diff --git a/cpp/src/Freeze/TransactionalEvictorContext.cpp b/cpp/src/Freeze/TransactionalEvictorContext.cpp index 2c68a4eae2e..99fd3ecdafa 100644 --- a/cpp/src/Freeze/TransactionalEvictorContext.cpp +++ b/cpp/src/Freeze/TransactionalEvictorContext.cpp @@ -24,7 +24,7 @@ using namespace Ice; // Freeze::TransactionalEvictorDeadlockException::TransactionalEvictorDeadlockException(const char* file, int line, const TransactionPtr& transaction) : - Ice::LocalException(file, line), + Ice::SystemException(file, line), tx(transaction) { } diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 2510db8cffa..c147357e62c 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -52,6 +52,15 @@ Ice::LocalException::~LocalException() throw() { } +Ice::SystemException::SystemException(const char* file, int line) : + LocalException(file, line) +{ +} + +Ice::SystemException::~SystemException() throw() +{ +} + #if defined(__SUNPRO_CC) ostream& Ice::operator<<(ostream& out, const Ice::UserException& ex) @@ -66,6 +75,13 @@ Ice::operator<<(ostream& out, const Ice::LocalException& ex) ex.ice_print(out); return out; } + +ostream& +Ice::operator<<(ostream& out, const Ice::SystemException& ex) +{ + ex.ice_print(out); + return out; +} #endif void diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index a46a4e9b0bb..8eedeffe6a1 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -34,7 +34,7 @@ IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalExceptionWr } void -IceInternal::LocalExceptionWrapper::throwUnknownWrapper(const std::exception& ex) +IceInternal::LocalExceptionWrapper::throwWrapper(const std::exception& ex) { const UserException* ue = dynamic_cast<const UserException*>(&ex); @@ -48,31 +48,21 @@ IceInternal::LocalExceptionWrapper::throwUnknownWrapper(const std::exception& ex const LocalException* le = dynamic_cast<const LocalException*>(&ex); if(le) { -#if 0 - // - // Commented-out code makes local exceptions fully location transparent, - // but the Freeze evictor relies on them not being transparent. - // if(dynamic_cast<const UnknownException*>(le) || dynamic_cast<const ObjectNotExistException*>(le) || dynamic_cast<const OperationNotExistException*>(le) || - dynamic_cast<const FacetNotExistException*>(le)) + dynamic_cast<const FacetNotExistException*>(le) || + dynamic_cast<const CollocationOptimizationException*>(le) || + dynamic_cast<const SystemException*>(le)) { throw LocalExceptionWrapper(*le, false); } stringstream s; s << *le; throw LocalExceptionWrapper(UnknownLocalException(__FILE__, __LINE__, s.str()), false); -#else - throw LocalExceptionWrapper(*le, false); -#endif } -#if 0 string msg = "std::exception: "; throw LocalExceptionWrapper(UnknownException(__FILE__, __LINE__, msg + ex.what()), false); -#else - throw ex; -#endif } const LocalException* diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 35ee8cae257..4d986ef0abc 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -1357,7 +1357,7 @@ IceDelegateD::Ice::Object::ice_isA(const string& __id, const Context* context) catch(const ::std::exception& __ex) { __direct.destroy(); - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1372,7 +1372,7 @@ IceDelegateD::Ice::Object::ice_isA(const string& __id, const Context* context) } catch(const ::std::exception& __ex) { - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1415,7 +1415,7 @@ IceDelegateD::Ice::Object::ice_ping(const ::Ice::Context* context) catch(const ::std::exception& __ex) { __direct.destroy(); - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1430,7 +1430,7 @@ IceDelegateD::Ice::Object::ice_ping(const ::Ice::Context* context) } catch(const ::std::exception& __ex) { - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1478,7 +1478,7 @@ IceDelegateD::Ice::Object::ice_ids(const ::Ice::Context* context) catch(const ::std::exception& __ex) { __direct.destroy(); - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1493,7 +1493,7 @@ IceDelegateD::Ice::Object::ice_ids(const ::Ice::Context* context) } catch(const ::std::exception& __ex) { - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1542,7 +1542,7 @@ IceDelegateD::Ice::Object::ice_id(const ::Ice::Context* context) catch(const ::std::exception& __ex) { __direct.destroy(); - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { @@ -1557,7 +1557,7 @@ IceDelegateD::Ice::Object::ice_id(const ::Ice::Context* context) } catch(const ::std::exception& __ex) { - LocalExceptionWrapper::throwUnknownWrapper(__ex); + LocalExceptionWrapper::throwWrapper(__ex); } catch(...) { diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index a608a38648b..b05911e333e 100755 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2991,7 +2991,7 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p) C << nl << "catch(const ::std::exception& __ex)"; C << sb; C << nl << "__direct.destroy();"; - C << nl << "::IceInternal::LocalExceptionWrapper::throwUnknownWrapper(__ex);"; + C << nl << "::IceInternal::LocalExceptionWrapper::throwWrapper(__ex);"; C << eb; C << nl << "catch(...)"; C << sb; @@ -3020,7 +3020,7 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p) C << eb; C << nl << "catch(const ::std::exception& __ex)"; C << sb; - C << nl << "::IceInternal::LocalExceptionWrapper::throwUnknownWrapper(__ex);"; + C << nl << "::IceInternal::LocalExceptionWrapper::throwWrapper(__ex);"; C << eb; C << nl << "catch(...)"; C << sb; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index a79a7f8333e..d705191ed2b 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -4170,7 +4170,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << nl << "catch(System.Exception ex__)"; _out << sb; - _out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(ex__);"; + _out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);"; _out << eb; _out << nl << "finally"; _out << sb; @@ -4189,7 +4189,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << nl << "catch(System.Exception ex__)"; _out << sb; - _out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(ex__);"; + _out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);"; _out << eb; _out << eb; _out << eb; diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 64870af0e4f..02d2686e84b 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4417,28 +4417,11 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) out << eb; } - // - // Next two catch handlers keep local exceptions non-transparent. - // - out << nl << "catch(Ice.UserException __ex)"; - out << sb; - out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(__ex);"; - out << eb; - out << nl << "catch(Ice.LocalException __ex)"; + out << nl << "catch(java.lang.Throwable __ex)"; out << sb; - out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(__ex);"; + out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);"; out << eb; - /* - // - // Commented-out code makes local exceptions fully location transparent, - // but the Freeze evictor relies on them being non-transparent. - // - out << nl << "catch(Ice.LocalException __ex)"; - out << sb; - out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(__ex);"; - out << eb; - */ out << nl << "finally"; out << sb; out << nl << "if(__direct != null)"; @@ -4457,7 +4440,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } out << nl << "catch(java.lang.Throwable __ex)"; out << sb; - out << nl << "IceInternal.LocalExceptionWrapper.throwUnknownWrapper(__ex);"; + out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);"; out << eb; out << eb; out << eb; |