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);