]> granicus.if.org Git - icinga2/commitdiff
Handle all exception types rather than just the ones inheriting from std::exception.
authorGunnar Beutner <gunnar@beutner.name>
Mon, 23 Jul 2012 06:57:19 +0000 (08:57 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 23 Jul 2012 06:57:19 +0000 (08:57 +0200)
base/asynctask.h
base/process.cpp
base/socket.cpp
base/streamlogger.cpp
cib/nagioschecktask.cpp
components/cibsync/cibsynccomponent.cpp

index aae361571fa0db1271052d31349f4a91a19229fc..d47065bf28f6eee5e5c681a270075915d6fa884d 100644 (file)
@@ -69,7 +69,7 @@ public:
 
                try {
                        Run();
-               } catch (const exception&) {
+               } catch (...) {
                        FinishException(boost::current_exception());
                }
        }
index d48b21bbbaa6ea9966736d56f9ad21c069338410..0ca2b6ba99bf8d45e8cbad9e037b2ac9c16ae3a1 100644 (file)
@@ -119,7 +119,7 @@ void Process::WorkerThreadProc(void)
                                int fd = task->GetFD();
                                if (fd >= 0)
                                        tasks[fd] = task;
-                       } catch (const exception&) {
+                       } catch (...) {
                                Event::Post(boost::bind(&Process::FinishException, task, boost::current_exception()));
                        }
 
index 7fa8d3d9ebd6430181494997e28cfd8f4730c20e..44b0ccbf32f502bda7edc73198d1c8498cfb5c86 100644 (file)
@@ -297,7 +297,7 @@ void Socket::ReadThreadProc(void)
 
                        if (FD_ISSET(fd, &exceptfds))
                                HandleException();
-               } catch (const exception&) {
+               } catch (...) {
                        m_Exception = boost::current_exception();
 
                        CloseInternal(false);
@@ -348,7 +348,7 @@ void Socket::WriteThreadProc(void)
 
                        if (FD_ISSET(fd, &writefds))
                                HandleWritable();
-               } catch (const exception&) {
+               } catch (...) {
                        m_Exception = boost::current_exception();
 
                        CloseInternal(false);
index 957f10c04f7bb4f6dd7d86bb6a27bb816091c041..9475d869bb6e7d4a067b8562480847c895a9fe6c 100644 (file)
@@ -39,7 +39,7 @@ void StreamLogger::OpenFile(const string& filename)
 
                if (!stream->good())
                        throw_exception(runtime_error("Could not open logfile '" + filename + "'"));
-       } catch (const exception&) {
+       } catch (...) {
                delete stream;
                throw;
        }
index b7466f405d136e2d8d4739dfeac732497f4dd559..b882168eb20493e2da63d694165851e9d3b6cf55 100644 (file)
@@ -61,7 +61,7 @@ void NagiosCheckTask::ProcessFinishedHandler(NagiosCheckTask ct)
 
        try {
                pr = ct.m_Process->GetResult();
-       } catch (const exception&) {
+       } catch (...) {
                ct.m_Task->FinishException(boost::current_exception());
                return;
        }
index de2d7098f51358aa09b5b2b793ade8a7861e3f80..d3fc478df6070780fdf1c3d325138fa497ef6dfd 100644 (file)
@@ -259,7 +259,7 @@ void CIBSyncComponent::RemoteObjectCommittedHandler(const Endpoint::Ptr& sender,
                m_SyncingConfig = true;
                object->Commit();
                m_SyncingConfig = false;
-       } catch (const exception&) {
+       } catch (...) {
                m_SyncingConfig = false;
                throw;
        }
@@ -289,7 +289,7 @@ void CIBSyncComponent::RemoteObjectRemovedHandler(const RequestMessage& request)
                        m_SyncingConfig = true;
                        object->Unregister();
                        m_SyncingConfig = false;
-               } catch (const exception&) {
+               } catch (...) {
                        m_SyncingConfig = false;
                        throw;
                }