Permalink
Browse files

Add try/catch around nzmqt::poll

Qt and exceptions thrown in event handlers... do not mix.
  • Loading branch information...
1 parent 051df03 commit 4c2fae028d8bab50420fbc2f8692c8d103f908af @Beirdo Beirdo committed May 12, 2012
Showing with 8 additions and 3 deletions.
  1. +5 −1 mythtv/external/nzmqt/include/nzmqt/nzmqt.hpp
  2. +3 −2 mythtv/libs/libmythbase/loggingserver.cpp
@@ -620,7 +620,11 @@ namespace nzmqt
if (m_stopped)
return;
- poll();
+ try {
+ poll();
+ } catch (ZMQException e) {
+ qWarning("Exception during poll: %s\n", e.what());
+ }
if (!m_stopped)
QTimer::singleShot(m_interval, this, SLOT(run()));
@@ -1282,9 +1282,10 @@ void LogForwardThread::forwardMessage(LogMessage *msg)
item->deleteItem();
}
}
- catch (...)
+ catch (nzmqt::ZMQException e)
{
- cout << "Exception occurred" << endl;
+ LOG(VB_GENERAL, LOG_ERR, QString("Exception during socket setup: %1")
+ .arg(e.what()));
}

0 comments on commit 4c2fae0

Please sign in to comment.