mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Throw PluginNotLoadedError from SortPlugins()
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "api/api_database.h"
|
||||
#include "api/helpers/logging.h"
|
||||
#include "api/sorting/plugin_sort.h"
|
||||
#include "loot/exception/plugin_not_loaded_error.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef UNICODE
|
||||
@@ -270,8 +271,8 @@ std::vector<std::string> Game::SortPlugins(
|
||||
for (const auto& pluginFilename : pluginFilenames) {
|
||||
const auto plugin = cache_.GetPlugin(pluginFilename);
|
||||
if (plugin == nullptr) {
|
||||
throw std::invalid_argument("The plugin \"" + pluginFilename +
|
||||
"\" has not been loaded.");
|
||||
throw PluginNotLoadedError("The plugin \"" + pluginFilename +
|
||||
"\" has not been loaded.");
|
||||
}
|
||||
|
||||
plugins.push_back(plugin.get());
|
||||
|
||||
@@ -467,7 +467,7 @@ TEST_P(GameInterfaceTest,
|
||||
TEST_P(GameInterfaceTest, sortPluginsShouldThrowIfAGivenPluginIsNotLoaded) {
|
||||
std::vector<std::string> plugins{blankEsp, blankDifferentEsp};
|
||||
|
||||
EXPECT_THROW(handle_->SortPlugins(plugins), std::invalid_argument);
|
||||
EXPECT_THROW(handle_->SortPlugins(plugins), PluginNotLoadedError);
|
||||
}
|
||||
|
||||
TEST_P(GameInterfaceTest, clearLoadedPluginsShouldClearThePluginsCache) {
|
||||
|
||||
Reference in New Issue
Block a user