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 {
|
||||
Run();
|
||||
} catch (const exception&) {
|
||||
} catch (...) {
|
||||
FinishException(boost::current_exception());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue