mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
fixed bug discovered during Qt5 migration: you can't throw nothing (unless you're rethrowing an already caught exception)
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include "blackmisc/context.h"
|
#include "blackmisc/context.h"
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
@@ -41,7 +42,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
if (! loader->load())
|
if (! loader->load())
|
||||||
{
|
{
|
||||||
throw;
|
throw std::runtime_error(QString("Failed loading plugin from %1").arg(filename).toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginEntry entry;
|
PluginEntry entry;
|
||||||
@@ -50,14 +51,14 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (! entry.factory)
|
if (! entry.factory)
|
||||||
{
|
{
|
||||||
throw;
|
throw std::runtime_error(QString("Plugin loaded from %1 is not compatible").arg(filename).toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_plugins.push_back(entry);
|
m_plugins.push_back(entry);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
//TODO warning
|
//TODO warning?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user