diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-10 16:00:58 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-10 16:00:58 +0200 |
commit | 8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4 (patch) | |
tree | 1cdcd88fccb57f88d2b47cd1757b4d43bc05be4b /cpp/src/Ice/Proxy.cpp | |
parent | Added IceGridGUI IceStorm metrics (diff) | |
download | ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.tar.bz2 ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.tar.xz ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.zip |
Improved tracing of failures, user exceptions are now tracked
with a userException member.
Diffstat (limited to 'cpp/src/Ice/Proxy.cpp')
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 161 |
1 files changed, 104 insertions, 57 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 59081974ffa..e2196926685 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -184,22 +184,31 @@ bool IceProxy::Ice::Object::end_ice_isA(const AsyncResultPtr& __result) { AsyncResult::__check(__result, this, ice_isA_name); - if(!__result->__wait()) + bool __ok = __result->__wait(); + try { - try - { - __result->__throwUserException(); - } - catch(const UserException& __ex) + if(!__ok) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + try + { + __result->__throwUserException(); + } + catch(const UserException& __ex) + { + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } } + bool __ret; + IceInternal::BasicStream* __is = __result->__startReadParams(); + __is->read(__ret); + __result->__endReadParams(); + return __ret; + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; } - bool __ret; - IceInternal::BasicStream* __is = __result->__startReadParams(); - __is->read(__ret); - __result->__endReadParams(); - return __ret; } void @@ -326,22 +335,31 @@ vector<string> IceProxy::Ice::Object::end_ice_ids(const AsyncResultPtr& __result) { AsyncResult::__check(__result, this, ice_ids_name); - if(!__result->__wait()) + bool __ok = __result->__wait(); + try { - try - { - __result->__throwUserException(); - } - catch(const UserException& __ex) + if(!__ok) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + try + { + __result->__throwUserException(); + } + catch(const UserException& __ex) + { + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } } + vector<string> __ret; + IceInternal::BasicStream* __is = __result->__startReadParams(); + __is->read(__ret); + __result->__endReadParams(); + return __ret; + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; } - vector<string> __ret; - IceInternal::BasicStream* __is = __result->__startReadParams(); - __is->read(__ret); - __result->__endReadParams(); - return __ret; } AsyncResultPtr @@ -368,22 +386,32 @@ string IceProxy::Ice::Object::end_ice_id(const AsyncResultPtr& __result) { AsyncResult::__check(__result, this, ice_id_name); - if(!__result->__wait()) + bool __ok = __result->__wait(); + try { - try - { - __result->__throwUserException(); - } - catch(const UserException& __ex) + if(!__ok) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + try + { + __result->__throwUserException(); + } + catch(const UserException& __ex) + { + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } } + string __ret; + IceInternal::BasicStream* __is = __result->__startReadParams(); + __is->read(__ret); + __result->__endReadParams(); + return __ret; + + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; } - string __ret; - IceInternal::BasicStream* __is = __result->__startReadParams(); - __is->read(__ret); - __result->__endReadParams(); - return __ret; } bool @@ -484,10 +512,18 @@ IceProxy::Ice::Object::end_ice_invoke(vector<Byte>& outEncaps, const AsyncResult bool ok = __result->__wait(); if(_reference->getMode() == Reference::ModeTwoway) { - const Byte* v; - Int sz; - __result->__readParamEncaps(v, sz); - vector<Byte>(v, v + sz).swap(outEncaps); + try + { + const Byte* v; + Int sz; + __result->__readParamEncaps(v, sz); + vector<Byte>(v, v + sz).swap(outEncaps); + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; + } } return ok; } @@ -606,9 +642,17 @@ IceProxy::Ice::Object::___end_ice_invoke(pair<const Byte*, const Byte*>& outEnca bool ok = __result->__wait(); if(_reference->getMode() == Reference::ModeTwoway) { - Int sz; - __result->__readParamEncaps(outEncaps.first, sz); - outEncaps.second = outEncaps.first + sz; + try + { + Int sz; + __result->__readParamEncaps(outEncaps.first, sz); + outEncaps.second = outEncaps.first + sz; + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; + } } return ok; } @@ -1300,10 +1344,6 @@ IceProxy::Ice::Object::__handleExceptionWrapper(const ::IceInternal::Handle< ::I observer.failed(ex.get()->ice_name()); ex.get()->ice_throw(); } - else - { - observer.retried(); - } return 0; } @@ -1328,7 +1368,6 @@ IceProxy::Ice::Object::__handleExceptionWrapperRelaxed(const ::IceInternal::Hand _delegate = 0; } } - observer.retried(); return 0; } } @@ -1365,21 +1404,29 @@ void IceProxy::Ice::Object::__end(const ::Ice::AsyncResultPtr& __result, const std::string& operation) const { AsyncResult::__check(__result, this, operation); - bool ok = __result->__wait(); + bool __ok = __result->__wait(); if(_reference->getMode() == Reference::ModeTwoway) { - if(!ok) + try { - try - { - __result->__throwUserException(); - } - catch(const UserException& __ex) + if(!__ok) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + try + { + __result->__throwUserException(); + } + catch(const UserException& __ex) + { + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } } + __result->__readEmptyParams(); + } + catch(const ::Ice::LocalException& ex) + { + __result->__getObserver().failed(ex.ice_name()); + throw; } - __result->__readEmptyParams(); } } |