diff options
author | Jose <jose@zeroc.com> | 2017-09-20 11:58:41 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-09-20 11:58:41 +0200 |
commit | a2857e814eaa97eedff81036aea6e845979083a5 (patch) | |
tree | dcba44230b386403684ae6d142c759337b047273 /cpp/src/Ice/Service.cpp | |
parent | Clean C++ exception code to only throw exception types (diff) | |
download | ice-a2857e814eaa97eedff81036aea6e845979083a5.tar.bz2 ice-a2857e814eaa97eedff81036aea6e845979083a5.tar.xz ice-a2857e814eaa97eedff81036aea6e845979083a5.zip |
Update Application and Service classes to catch Ice::Exception
- update Ice::Application and Ice::Service to catch Ice::Exception
in addition to std::exception to get stack trace from Ice::Exception
base class.
Diffstat (limited to 'cpp/src/Ice/Service.cpp')
-rw-r--r-- | cpp/src/Ice/Service.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 324abfc1115..bec4df2ded3 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -507,6 +507,11 @@ Ice::Service::shutdown() // Expected if the service communicator is being destroyed. // } + catch(const Ice::Exception& ex) + { + ServiceWarning warn(this); + warn << "exception during shutdown:\n" << ex; + } catch(const std::exception& ex) { ServiceWarning warn(this); @@ -837,6 +842,11 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData& } } } + catch(const Ice::Exception& ex) + { + ServiceError err(this); + err << "service terminating after catching exception:\n" << ex; + } catch(const std::exception& ex) { ServiceError err(this); @@ -1359,6 +1369,11 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[]) status = tmpStatus; } } + catch(const Ice::Exception& ex) + { + ServiceError err(this); + err << "service terminating after catching exception:\n" << ex; + } catch(const std::exception& ex) { ServiceError err(this); @@ -1793,6 +1808,12 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa } } } + catch(const Ice::Exception& ex) + { + ServiceError err(this); + err << "service terminating after catching exception:\n" << ex; + errMsg = err.str(); + } catch(const std::exception& ex) { ServiceError err(this); |