diff --git a/src/api/game/game.cpp b/src/api/game/game.cpp index 65791016..66691d08 100644 --- a/src/api/game/game.cpp +++ b/src/api/game/game.cpp @@ -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 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()); diff --git a/src/tests/api/interface/game_interface_test.h b/src/tests/api/interface/game_interface_test.h index 0a1173d0..a077fe37 100644 --- a/src/tests/api/interface/game_interface_test.h +++ b/src/tests/api/interface/game_interface_test.h @@ -467,7 +467,7 @@ TEST_P(GameInterfaceTest, TEST_P(GameInterfaceTest, sortPluginsShouldThrowIfAGivenPluginIsNotLoaded) { std::vector plugins{blankEsp, blankDifferentEsp}; - EXPECT_THROW(handle_->SortPlugins(plugins), std::invalid_argument); + EXPECT_THROW(handle_->SortPlugins(plugins), PluginNotLoadedError); } TEST_P(GameInterfaceTest, clearLoadedPluginsShouldClearThePluginsCache) {