From 6c1d3ce8fae8884e4ff72de6cea89e7a419cd0fe Mon Sep 17 00:00:00 2001 From: ZavGaro Date: Wed, 21 Aug 2024 09:42:46 +0300 Subject: [PATCH] Trow mod error exception if given init script doesn't exist on mod loading --- src/script/cpp_api/s_base.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index cddd8cd34..e83157bd9 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -267,9 +267,9 @@ void ScriptApiBase::loadMod(const std::string &script_path, const std::string &mod_name) { if (!fs::IsFile(script_path)) { - errorstream << "Mod error: Failed to load mod \"" << mod_name - << "\" as script \"" << script_path << "\" does not exist" << std::endl; - return; + throw ModError("Failed to load mod \"" + mod_name + + "\" as it's initialization script at \"" + script_path + + "\" does not exist. Try to reinstall/update mod or disable it."); } ModNameStorer mod_name_storer(getStack(), mod_name);