summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/IcePack/simple/app.xml12
-rw-r--r--cpp/slice/Ice/LocalException.ice14
-rw-r--r--cpp/src/Ice/Exception.cpp11
-rw-r--r--cpp/src/Ice/Instance.cpp6
-rw-r--r--cpp/src/Ice/PropertiesI.cpp3
5 files changed, 42 insertions, 4 deletions
diff --git a/cpp/demo/IcePack/simple/app.xml b/cpp/demo/IcePack/simple/app.xml
index 79ffbd9ff00..343a2718a39 100644
--- a/cpp/demo/IcePack/simple/app.xml
+++ b/cpp/demo/IcePack/simple/app.xml
@@ -62,6 +62,7 @@
<property name="Name" value="${service}"/>
</properties>
</service-template>
+
<node name="node">
<variable name="node1" value="test"/>
@@ -71,6 +72,17 @@
<server-instance template="IceBoxTemplate" name="IceBox"/>
<server-instance template="ServerTemplate" name="Server"/>
<server-instance template="ServerTemplate" name="Server2"/>
+
+ <server name="node-1" exe="icegridnode">
+ <adapters>
+ <adapter name="IceGrid.Node" endpoints="default"/>
+ </adapters>
+ <properties>
+ <property name="IceGrid.Node.Name" value="${server}"/>
+ <property name="IceGrid.Node.Data" value="db/${server}"/>
+ </properties>
+ </server>
+
</node>
</application>
diff --git a/cpp/slice/Ice/LocalException.ice b/cpp/slice/Ice/LocalException.ice
index ca349ced091..816a0634528 100644
--- a/cpp/slice/Ice/LocalException.ice
+++ b/cpp/slice/Ice/LocalException.ice
@@ -138,7 +138,7 @@ local exception ObjectAdapterDeactivatedException
* the same adapter id.
*
**/
-#ifndef ICE_NO_ROUTER
+#ifndef ICE_NO_LOCATOR
local exception ObjectAdapterIdInUseException
{
/**
@@ -314,6 +314,18 @@ local exception SocketException extends SyscallException
/**
*
+ * This exception is a specialization of [SyscallException] for file
+ * errors.
+ *
+ **/
+local exception FileException extends SyscallException
+{
+ /** The path of the file responsible for the error. */
+ string path;
+};
+
+/**
+ *
* This exception is a specialization of [SocketException] for
* connection failures.
*
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index 97e674f6952..52e531a8cd1 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -194,6 +194,17 @@ Ice::SocketException::ice_print(ostream& out) const
}
void
+Ice::FileException::ice_print(ostream& out) const
+{
+ Exception::ice_print(out);
+ out << ":\nfile exception: " << errorToString(error);
+ if(!path.empty())
+ {
+ out << "\npath: " << path;
+ }
+}
+
+void
Ice::ConnectFailedException::ice_print(ostream& out) const
{
Exception::ice_print(out);
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 3b9403d825e..73c99c93176 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -420,7 +420,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
FILE* file = freopen(stdOutFilename.c_str(), "a", stdout);
if(file == 0)
{
- SyscallException ex(__FILE__, __LINE__);
+ FileException ex(__FILE__, __LINE__);
+ ex.path = stdOutFilename;
ex.error = getSystemErrno();
throw ex;
}
@@ -431,7 +432,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
FILE* file = freopen(stdErrFilename.c_str(), "a", stderr);
if(file == 0)
{
- SyscallException ex(__FILE__, __LINE__);
+ FileException ex(__FILE__, __LINE__);
+ ex.path = stdErrFilename;
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 91b5963f9ee..fc3f9a7fd0c 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -222,7 +222,8 @@ Ice::PropertiesI::load(const std::string& file)
ifstream in(file.c_str());
if(!in)
{
- SyscallException ex(__FILE__, __LINE__);
+ FileException ex(__FILE__, __LINE__);
+ ex.path = file;
ex.error = getSystemErrno();
throw ex;
}