summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PropertiesI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r--cpp/src/Ice/PropertiesI.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 12b337f0987..5a65b119cc9 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -308,9 +308,8 @@ Ice::PropertiesI::load(const std::string& file)
LONG err;
if((err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, keyName.c_str(), 0, KEY_QUERY_VALUE, &iceKey)) != ERROR_SUCCESS)
{
- InitializationException ex(__FILE__, __LINE__);
- ex.reason = "could not open Windows registry key `" + file + "':\n" + IceUtilInternal::errorToString(err);
- throw ex;
+ throw InitializationException(__FILE__, __LINE__, "could not open Windows registry key `" + file + "':\n" +
+ IceUtilInternal::errorToString(err));
}
DWORD maxNameSize; // Size in characters not including terminating null character.
@@ -322,10 +321,8 @@ Ice::PropertiesI::load(const std::string& file)
ICE_NULLPTR, ICE_NULLPTR);
if(err != ERROR_SUCCESS)
{
- InitializationException ex(__FILE__, __LINE__);
- ex.reason = "could not open Windows registry key `" + file + "':\n";
- ex.reason += IceUtilInternal::errorToString(err);
- throw ex;
+ throw InitializationException(__FILE__, __LINE__, "could not open Windows registry key `" + file + "':\n" +
+ IceUtilInternal::errorToString(err));
}
for(DWORD i = 0; i < numValues; ++i)
@@ -403,10 +400,7 @@ Ice::PropertiesI::load(const std::string& file)
ifstream in(IceUtilInternal::streamFilename(file).c_str());
if(!in)
{
- FileException ex(__FILE__, __LINE__);
- ex.path = file;
- ex.error = getSystemErrno();
- throw ex;
+ throw FileException(__FILE__, __LINE__, getSystemErrno(), file);
}
string line;