mirror of https://github.com/Icinga/icinga2.git
Handle all exception types rather than just the ones inheriting from std::exception.
This commit is contained in:
parent
1065bc168b
commit
bcb1b23d9f
|
@ -69,7 +69,7 @@ public:
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Run();
|
Run();
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
FinishException(boost::current_exception());
|
FinishException(boost::current_exception());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ void Process::WorkerThreadProc(void)
|
||||||
int fd = task->GetFD();
|
int fd = task->GetFD();
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
tasks[fd] = task;
|
tasks[fd] = task;
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
Event::Post(boost::bind(&Process::FinishException, task, boost::current_exception()));
|
Event::Post(boost::bind(&Process::FinishException, task, boost::current_exception()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ void Socket::ReadThreadProc(void)
|
||||||
|
|
||||||
if (FD_ISSET(fd, &exceptfds))
|
if (FD_ISSET(fd, &exceptfds))
|
||||||
HandleException();
|
HandleException();
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
m_Exception = boost::current_exception();
|
m_Exception = boost::current_exception();
|
||||||
|
|
||||||
CloseInternal(false);
|
CloseInternal(false);
|
||||||
|
@ -348,7 +348,7 @@ void Socket::WriteThreadProc(void)
|
||||||
|
|
||||||
if (FD_ISSET(fd, &writefds))
|
if (FD_ISSET(fd, &writefds))
|
||||||
HandleWritable();
|
HandleWritable();
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
m_Exception = boost::current_exception();
|
m_Exception = boost::current_exception();
|
||||||
|
|
||||||
CloseInternal(false);
|
CloseInternal(false);
|
||||||
|
|
|
@ -39,7 +39,7 @@ void StreamLogger::OpenFile(const string& filename)
|
||||||
|
|
||||||
if (!stream->good())
|
if (!stream->good())
|
||||||
throw_exception(runtime_error("Could not open logfile '" + filename + "'"));
|
throw_exception(runtime_error("Could not open logfile '" + filename + "'"));
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
delete stream;
|
delete stream;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ void NagiosCheckTask::ProcessFinishedHandler(NagiosCheckTask ct)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pr = ct.m_Process->GetResult();
|
pr = ct.m_Process->GetResult();
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
ct.m_Task->FinishException(boost::current_exception());
|
ct.m_Task->FinishException(boost::current_exception());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ void CIBSyncComponent::RemoteObjectCommittedHandler(const Endpoint::Ptr& sender,
|
||||||
m_SyncingConfig = true;
|
m_SyncingConfig = true;
|
||||||
object->Commit();
|
object->Commit();
|
||||||
m_SyncingConfig = false;
|
m_SyncingConfig = false;
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
m_SyncingConfig = false;
|
m_SyncingConfig = false;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ void CIBSyncComponent::RemoteObjectRemovedHandler(const RequestMessage& request)
|
||||||
m_SyncingConfig = true;
|
m_SyncingConfig = true;
|
||||||
object->Unregister();
|
object->Unregister();
|
||||||
m_SyncingConfig = false;
|
m_SyncingConfig = false;
|
||||||
} catch (const exception&) {
|
} catch (...) {
|
||||||
m_SyncingConfig = false;
|
m_SyncingConfig = false;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue