mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Fix server crashing on Lua errors
Previously, the server called FATAL_ERROR when a Lua error occured. This caused a (mostly useless) core dump. The server now simply throws an exception, which is caught and printed before exiting with a non-zero return value. This also fixes a number of instances where errors were logged multiple times.
This commit is contained in:
@@ -63,9 +63,9 @@ public:
|
||||
ScriptApiBase();
|
||||
virtual ~ScriptApiBase();
|
||||
|
||||
bool loadMod(const std::string &script_path, const std::string &mod_name,
|
||||
std::string *error=NULL);
|
||||
bool loadScript(const std::string &script_path, std::string *error=NULL);
|
||||
// These throw a ModError on failure
|
||||
void loadMod(const std::string &script_path, const std::string &mod_name);
|
||||
void loadScript(const std::string &script_path);
|
||||
|
||||
void runCallbacksRaw(int nargs,
|
||||
RunCallbacksMode mode, const char *fxn);
|
||||
|
Reference in New Issue
Block a user