summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp4
-rw-r--r--cpp/src/Ice/Connection.cpp2
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp2
-rw-r--r--cpp/src/Ice/Incoming.cpp100
-rw-r--r--cpp/src/IcePack/Registry.cpp2
5 files changed, 95 insertions, 15 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 6542c8000c1..2aa716c8099 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -303,12 +303,12 @@ Ice::CommunicatorI::~CommunicatorI()
if(_instance->__getRef() > 1)
{
PropertiesPtr properties = _instance->properties();
- if(properties->getPropertyAsIntWithDefault("Ice.LeakWarnings", 1) > 0)
+ if(properties->getPropertyAsIntWithDefault("Ice.Warn.Leak", 1) > 0)
{
Warning warn(_instance->logger());
warn <<
"The communicator is not the last Ice object that is deleted. (You can\n"
- "disable this warning by setting the property `Ice.LeakWarnings' to 0.)";
+ "disable this warning by setting the property `Ice.Warn.Leak' to 0.)";
}
}
}
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index 58346dc19a7..5fefc2c52ca 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -852,7 +852,7 @@ IceInternal::Connection::Connection(const InstancePtr& instance,
_logger(_instance->logger()),
_traceLevels(_instance->traceLevels()),
_defaultsAndOverrides(_instance->defaultsAndOverrides()),
- _warn(_instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0),
+ _warn(_instance->properties()->getPropertyAsInt("Ice.Warn.Connection") > 0),
_nextRequestId(1),
_requestsHint(_requests.end()),
_batchStream(_instance),
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index a57e8970ddb..f1a48ca82dc 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -438,7 +438,7 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance
EventHandler(instance),
_endpoint(endpoint),
_adapter(adapter),
- _warn(_instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0),
+ _warn(_instance->properties()->getPropertyAsInt("Ice.Warn.Connection") > 0),
_state(StateHolding),
_registeredWithPool(false)
{
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 77726314632..622878289f9 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -17,6 +17,9 @@
#include <Ice/ServantLocator.h>
#include <Ice/Object.h>
#include <Ice/LocalException.h>
+#include <Ice/Instance.h>
+#include <Ice/Properties.h>
+#include <Ice/LoggerUtil.h>
using namespace std;
using namespace Ice;
@@ -156,7 +159,7 @@ IceInternal::Incoming::invoke(bool response)
return;
}
- catch(const RequestFailedException& ex)
+ catch(RequestFailedException& ex)
{
if(locator && servant)
{
@@ -169,15 +172,15 @@ IceInternal::Incoming::invoke(bool response)
{
_os.endWriteEncaps();
_os.b.resize(statusPos);
- if(dynamic_cast<const ObjectNotExistException*>(&ex))
+ if(dynamic_cast<ObjectNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchObjectNotExist));
}
- else if(dynamic_cast<const FacetNotExistException*>(&ex))
+ else if(dynamic_cast<FacetNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchFacetNotExist));
}
- else if(dynamic_cast<const OperationNotExistException*>(&ex))
+ else if(dynamic_cast<OperationNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchOperationNotExist));
}
@@ -185,14 +188,61 @@ IceInternal::Incoming::invoke(bool response)
{
assert(false);
}
- // Write the data from the exception, not from _current,
- // so that a RequestFailedException can override the
- // information from _current.
- ex.id.__write(&_os);
- _os.write(ex.facet);
- _os.write(ex.operation);
+
+ //
+ // Write the data from the exception if set so that a
+ // RequestFailedException can override the information
+ // from _current.
+ //
+ if(!ex.id.name.empty())
+ {
+ ex.id.__write(&_os);
+ }
+ else
+ {
+ _current.id.__write(&_os);
+ }
+
+ if(!ex.facet.empty())
+ {
+ _os.write(ex.facet);
+ }
+ else
+ {
+ _os.write(_current.facet);
+ }
+
+ if(ex.operation.empty())
+ {
+ _os.write(ex.operation);
+ }
+ else
+ {
+ _os.write(_current.operation);
+ }
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1)
+ {
+ if(ex.id.name.empty())
+ {
+ ex.id = _current.id;
+ }
+
+ if(ex.facet.empty() && !_current.facet.empty())
+ {
+ ex.facet = _current.facet;
+ }
+
+ if(ex.operation.empty() && !_current.operation.empty())
+ {
+ ex.operation = _current.operation;
+ }
+
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception:\n" << ex;
+ }
+
return;
}
catch(const LocalException& ex)
@@ -214,6 +264,12 @@ IceInternal::Incoming::invoke(bool response)
_os.write(str.str());
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception: unknown local exception:\n" << ex;
+ }
+
return;
}
catch(const UserException& ex)
@@ -235,6 +291,12 @@ IceInternal::Incoming::invoke(bool response)
_os.write(str.str());
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception: unknown user exception:\n" << ex;
+ }
+
return;
}
catch(const Exception& ex)
@@ -256,6 +318,12 @@ IceInternal::Incoming::invoke(bool response)
_os.write(str.str());
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception: unknown exception:\n" << ex;
+ }
+
return;
}
catch(const std::exception& ex)
@@ -277,6 +345,12 @@ IceInternal::Incoming::invoke(bool response)
_os.write(str.str());
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception: unknown std::exception: " << ex.what();
+ }
+
return;
}
catch(...)
@@ -297,6 +371,12 @@ IceInternal::Incoming::invoke(bool response)
_os.write(reason);
}
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ Warning out(_os.instance()->logger());
+ out << "dispatch exception: unknown c++ exception";
+ }
+
return;
}
diff --git a/cpp/src/IcePack/Registry.cpp b/cpp/src/IcePack/Registry.cpp
index eb7c2ffb5a9..180978a2f96 100644
--- a/cpp/src/IcePack/Registry.cpp
+++ b/cpp/src/IcePack/Registry.cpp
@@ -250,7 +250,7 @@ IcePack::Registry::start(bool nowarn)
// (_communicator).
//
_locatorComm = Ice::initializeWithProperties(argc, argv, _communicator->getProperties());
- _locatorComm->getProperties()->setProperty("Ice.LeakWarnings", "0");
+ _locatorComm->getProperties()->setProperty("Ice.Warn.Leak", "0");
_locatorComm->getProperties()->setProperty(
"Ice.ServerThreadPool.Size",
properties->getPropertyWithDefault("IcePack.Registry.Locator.ServerThreadPool.Size", "6"));