fixed bug discovered during Qt5 migration: you can't throw nothing (unless you're rethrowing an already caught exception)

This commit is contained in:
Mathew Sutcliffe
2013-07-18 20:43:46 +01:00
parent 6736209945
commit 1c5293f38f

View File

@@ -8,6 +8,7 @@
#include "blackmisc/context.h"
#include <QDirIterator>
#include <iostream>
#include <stdexcept>
namespace BlackCore
{
@@ -41,7 +42,7 @@ namespace BlackCore
{
if (! loader->load())
{
throw;
throw std::runtime_error(QString("Failed loading plugin from %1").arg(filename).toStdString());
}
PluginEntry entry;
@@ -50,14 +51,14 @@ namespace BlackCore
if (! entry.factory)
{
throw;
throw std::runtime_error(QString("Plugin loaded from %1 is not compatible").arg(filename).toStdString());
}
m_plugins.push_back(entry);
}
catch (...)
{
//TODO warning
//TODO warning?
}
}
}