diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-10-29 14:48:10 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-10-31 13:28:58 -0400 |
commit | 9269a0ecc7267822bc5ac5af95ad4977bdc94fec (patch) | |
tree | 1cf8639cc0a6b367670ac673780f321f85b467be /src/script/cpp_api/s_base.h | |
parent | b872df6ef6a15ae4624b35ea7b8960bc24da1128 (diff) | |
download | dragonfireclient-9269a0ecc7267822bc5ac5af95ad4977bdc94fec.tar.xz |
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.
Diffstat (limited to 'src/script/cpp_api/s_base.h')
-rw-r--r-- | src/script/cpp_api/s_base.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h index d490f7dfd..20f4bc11b 100644 --- a/src/script/cpp_api/s_base.h +++ b/src/script/cpp_api/s_base.h @@ -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); |