From b9e90a9c390c55244a65472ef93d01baefca8c4d Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 8 Aug 2012 15:22:27 +0200 Subject: Fixes --- cpp/src/Ice/Incoming.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'cpp/src/Ice/Incoming.cpp') diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 3128a6f1f24..9c854ffb8dc 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -148,6 +148,11 @@ IncomingBase::__writeParamEncaps(const Byte* v, Ice::Int sz, bool ok) void IncomingBase::__writeUserException(const Ice::UserException& ex, Ice::FormatType format) { + if(_observer) + { + _observer.failed(ex.ice_name()); + } + ::IceInternal::BasicStream* __os = __startWriteParams(format); __os->write(ex); __endWriteParams(false); @@ -208,6 +213,11 @@ IceInternal::IncomingBase::__servantLocatorFinished() { assert(_connection); + if(_observer) + { + _observer.failed(ex.ice_name()); + } + // // The operation may have already marshaled a reply; we must overwrite that reply. // @@ -269,6 +279,11 @@ IceInternal::IncomingBase::__handleException(const std::exception& exc) __warning(*rfe); } + if(_observer) + { + _observer.failed(rfe->ice_name()); + } + if(_response) { _os.b.resize(headerSize + 4); // Reply status position. @@ -314,12 +329,16 @@ IceInternal::IncomingBase::__handleException(const std::exception& exc) } else if(const Exception* ex = dynamic_cast(&exc)) { - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) { __warning(*ex); } + if(_observer) + { + _observer.failed(ex->ice_name()); + } + if(_response) { _os.b.resize(headerSize + 4); // Reply status position. @@ -386,6 +405,11 @@ IceInternal::IncomingBase::__handleException(const std::exception& exc) __warning(string("std::exception: ") + exc.what()); } + if(_observer) + { + _observer.failed(typeid(exc).name()); + } + if(_response) { _os.b.resize(headerSize + 4); // Reply status position. @@ -415,6 +439,11 @@ IceInternal::IncomingBase::__handleException() assert(_connection); + if(_observer) + { + _observer.failed("unknown"); + } + if(_response) { _os.b.resize(headerSize + 4); // Reply status position. @@ -586,6 +615,11 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager, BasicStre { Ice::EncodingVersion encoding = _is->skipEncaps(); // Required for batch requests. + if(_observer) + { + _observer.failed(ex.ice_name()); + } + if(_response) { _os.write(replyUserException); -- cgit v1.2.3