diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 55 | ||||
-rw-r--r-- | cpp/src/Ice/IncomingAsync.cpp | 32 |
2 files changed, 63 insertions, 24 deletions
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 9a5a6455fae..6610a8e5e59 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -88,24 +88,21 @@ IceInternal::IncomingBase::__warning(const Exception& ex) const void IceInternal::IncomingBase::__warning(const string& msg) const { - if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + Warning out(_os.instance()->logger()); + + out << "dispatch exception: " << msg; + out << "\nidentity: " << _current.id; + out << "\nfacet: "; + vector<string>::const_iterator p = _current.facet.begin(); + while(p != _current.facet.end()) { - Warning out(_os.instance()->logger()); - - out << "dispatch exception: " << msg; - out << "\nidentity: " << _current.id; - out << "\nfacet: "; - vector<string>::const_iterator p = _current.facet.begin(); - while(p != _current.facet.end()) + out << encodeString(*p++, "/"); + if(p != _current.facet.end()) { - out << encodeString(*p++, "/"); - if(p != _current.facet.end()) - { - out << '/'; - } + out << '/'; } - out << "\noperation: " << _current.operation; } + out << "\noperation: " << _current.operation; } IceInternal::Incoming::Incoming(Instance* instance, Connection* connection, @@ -221,7 +218,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) ex.operation = _current.operation; } - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1) + { + __warning(ex); + } if(_response) { @@ -254,7 +254,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) } catch(const LocalException& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -272,7 +275,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) } catch(const UserException& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -290,7 +296,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) } catch(const Exception& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -308,7 +317,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) } catch(const std::exception& ex) { - __warning(string("std::exception: ") + ex.what()); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(string("std::exception: ") + ex.what()); + } if(_response) { @@ -326,7 +338,10 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) } catch(...) { - __warning("unknown c++ exception"); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning("unknown c++ exception"); + } if(_response) { diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp index f95d325eb10..80cdc47997c 100644 --- a/cpp/src/Ice/IncomingAsync.cpp +++ b/cpp/src/Ice/IncomingAsync.cpp @@ -18,6 +18,8 @@ #include <Ice/Connection.h> #include <Ice/LocalException.h> #include <Ice/Protocol.h> +#include <Ice/Instance.h> +#include <Ice/Properties.h> using namespace std; using namespace Ice; @@ -87,7 +89,10 @@ IceInternal::IncomingAsync::__exception(const Exception& exc) ex.operation = _current.operation; } - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1) + { + __warning(ex); + } if(_response) { @@ -116,7 +121,10 @@ IceInternal::IncomingAsync::__exception(const Exception& exc) } catch(const LocalException& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -130,7 +138,10 @@ IceInternal::IncomingAsync::__exception(const Exception& exc) } catch(const UserException& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -144,7 +155,10 @@ IceInternal::IncomingAsync::__exception(const Exception& exc) } catch(const Exception& ex) { - __warning(ex); + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(ex); + } if(_response) { @@ -166,6 +180,11 @@ IceInternal::IncomingAsync::__exception(const std::exception& ex) assert(!_finished); _finished = true; + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning(string("std::exception: ") + ex.what()); + } + if(_response) { _os.endWriteEncaps(); @@ -185,6 +204,11 @@ IceInternal::IncomingAsync::__exception() assert(!_finished); _finished = true; + if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) + { + __warning("unknown c++ exception"); + } + if(_response) { _os.endWriteEncaps(); |