summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Application.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-05-07 09:44:25 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-05-07 09:44:25 -0230
commit2d0d9ef78501a0d3c9b6ab77bd31afa845db7cd3 (patch)
treeda8bb8159c737559c48989869a23e280e7cb38bd /cpp/src/Ice/Application.cpp
parentBug 3624 - desupport HP (diff)
downloadice-2d0d9ef78501a0d3c9b6ab77bd31afa845db7cd3.tar.bz2
ice-2d0d9ef78501a0d3c9b6ab77bd31afa845db7cd3.tar.xz
ice-2d0d9ef78501a0d3c9b6ab77bd31afa845db7cd3.zip
Bug 2664 - show stack traces with C++
Diffstat (limited to 'cpp/src/Ice/Application.cpp')
-rw-r--r--cpp/src/Ice/Application.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index be6639227de..219f571810b 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -123,6 +123,14 @@ destroyOnInterruptCallback(int signal)
assert(_communicator != 0);
_communicator->destroy();
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ out << _appName << " (while destroying in response to signal " << signal << "): " << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());
@@ -178,6 +186,15 @@ shutdownOnInterruptCallback(int signal)
assert(_communicator != 0);
_communicator->shutdown();
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ out << _appName << " (while shutting down in response to signal " << signal << "): std::exception: "
+ << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());
@@ -231,6 +248,15 @@ callbackOnInterruptCallback(int signal)
assert(_application != 0);
_application->interruptCallback(signal);
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ out << _appName << " (while interrupting in response to signal " << signal << "): std::exception: "
+ << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());
@@ -290,6 +316,19 @@ Ice::Application::main(int argc, char* argv[], const char* configFile)
initData.properties = createProperties();
initData.properties->load(configFile);
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ if(argv[0])
+ {
+ out << argv[0] << ": ";
+ }
+ out << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ return EXIT_FAILURE;
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());
@@ -607,6 +646,15 @@ Ice::Application::mainInternal(int argc, char* argv[], const InitializationData&
status = run(argc, argv);
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ out << ": " << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ status = EXIT_FAILURE;
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());
@@ -670,6 +718,15 @@ Ice::Application::mainInternal(int argc, char* argv[], const InitializationData&
{
_communicator->destroy();
}
+ catch(const Ice::Exception& ex)
+ {
+ Error out(getProcessLogger());
+ out << _appName << ": " << ex.what();
+#ifdef __GNUC__
+ out << "\n" << ex.ice_stackTrace();
+#endif
+ status = EXIT_FAILURE;
+ }
catch(const std::exception& ex)
{
Error out(getProcessLogger());