summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SslConfig.cpp
diff options
context:
space:
mode:
authorAnthony Neal <aneal@zeroc.com>2001-11-19 16:57:26 +0000
committerAnthony Neal <aneal@zeroc.com>2001-11-19 16:57:26 +0000
commit49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5 (patch)
tree57959cf59c2e4c7e45449a63a5a8362cd3bbb05c /cpp/src/Ice/SslConfig.cpp
parentFixed some bugs regarding exception message reporting. (diff)
downloadice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.tar.bz2
ice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.tar.xz
ice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.zip
Now Ssl (Security) exceptions are genereated from slice.
Diffstat (limited to 'cpp/src/Ice/SslConfig.cpp')
-rw-r--r--cpp/src/Ice/SslConfig.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/cpp/src/Ice/SslConfig.cpp b/cpp/src/Ice/SslConfig.cpp
index ddba7ef5250..6333726cf33 100644
--- a/cpp/src/Ice/SslConfig.cpp
+++ b/cpp/src/Ice/SslConfig.cpp
@@ -20,7 +20,7 @@
#include <util/Janitor.hpp>
#include <Ice/Security.h>
-#include <Ice/SslException.h>
+#include <Ice/SecurityException.h>
#include <Ice/SslConfigErrorReporter.h>
#include <Ice/SslConfig.h>
@@ -60,11 +60,15 @@ IceSecurity::Ssl::Parser::process()
}
catch(const XMLException& toCatch)
{
- ostringstream s;
+ ConfigParseException configEx(__FILE__, __LINE__);
+
+ ostringstream s;
s << "While parsing " << _configFile << flush;
s << "Xerces-c Init Exception: " << DOMString(toCatch.getMessage());
- throw ConfigParseException(s.str().c_str(), __FILE__, __LINE__);
+ configEx._message = s.str();
+
+ throw configEx;
}
int errorCount = 0;
@@ -128,11 +132,15 @@ IceSecurity::Ssl::Parser::process()
delete errReporter;
}
+ ConfigParseException configEx(__FILE__, __LINE__);
+
ostringstream s;
s << "While parsing " << _configFile << flush;
s << "Xerces-c Parsing Error: " << DOMString(e.getMessage());
- throw ConfigParseException(s.str().c_str(), __FILE__, __LINE__);
+ configEx._message = s.str();
+
+ throw configEx;
}
catch (const DOM_DOMException& e)
{
@@ -141,12 +149,16 @@ IceSecurity::Ssl::Parser::process()
delete errReporter;
}
+ ConfigParseException configEx(__FILE__, __LINE__);
+
ostringstream s;
s << "While parsing " << _configFile << flush;
s << "Xerces-c DOM Parsing Error, DOMException code: " << e.code;
s << ", message: " << e.msg;
- throw ConfigParseException(s.str().c_str(), __FILE__, __LINE__);
+ configEx._message = s.str();
+
+ throw configEx;
}
catch (...)
{
@@ -155,9 +167,11 @@ IceSecurity::Ssl::Parser::process()
delete errReporter;
}
- string s = "While parsing " + _configFile + "\n" + "An unknown error occured during parsing.";
+ ConfigParseException configEx(__FILE__, __LINE__);
- throw ConfigParseException(s.c_str(), __FILE__, __LINE__);
+ configEx._message = "While parsing " + _configFile + "\n" + "An unknown error occured during parsing.";
+
+ throw configEx;
}
if (errReporter != 0)
@@ -167,9 +181,11 @@ IceSecurity::Ssl::Parser::process()
if (errorCount)
{
- string s = errorCount + "errors occured during parsing.";
+ ConfigParseException configEx(__FILE__, __LINE__);
+
+ configEx._message = errorCount + "errors occured during parsing.";
- throw ConfigParseException(s.c_str(), __FILE__, __LINE__);
+ throw configEx;
}
}