Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion common/source/EventThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,20 @@ void EventThread::threadExecutor()
m_lock.unlock();

if (func)
func();
{
try
{
func();
}
catch (const std::exception &e)
{
RIALTO_COMMON_LOG_ERROR("Exception thrown by event thread callback: %s", e.what());
}
catch (...)
{
RIALTO_COMMON_LOG_ERROR("Unknown exception thrown by event thread callback");
}
}

m_lock.lock();
}
Expand Down
13 changes: 12 additions & 1 deletion media/server/gstplayer/source/WorkerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,18 @@ void WorkerThread::taskHandler()
while (m_isTaskThreadActive)
{
std::unique_ptr<IPlayerTask> task = waitForTask();
task->execute();
try
{
task->execute();
}
catch (const std::exception &e)
{
RIALTO_SERVER_LOG_ERROR("Exception thrown by task on the worker thread: %s", e.what());
}
catch (...)
{
RIALTO_SERVER_LOG_ERROR("Unknown exception thrown by task on the worker thread");
}
}
}

Expand Down
13 changes: 12 additions & 1 deletion media/server/main/source/MainThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,18 @@ void MainThread::mainThreadLoop()
const std::shared_ptr<TaskInfo> kTaskInfo = waitForTask();
if (m_registeredClients.find(kTaskInfo->clientId) != m_registeredClients.end())
{
kTaskInfo->task();
try
{
kTaskInfo->task();
}
catch (const std::exception &e)
{
RIALTO_SERVER_LOG_ERROR("Exception thrown by task on the main thread: %s", e.what());
}
catch (...)
{
RIALTO_SERVER_LOG_ERROR("Unknown exception thrown by task on the main thread");
}
}
else
{
Expand Down
Loading