From: sapier Date: Sun, 25 Aug 2013 10:54:16 +0000 (+0200) Subject: Add backtrace to error function X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=5b518ed2feff28c9bf21ad940c1b211b72d71bd1;p=zefram%2Fminetest%2Fminetest_engine.git Add backtrace to error function --- diff --git a/builtin/builtin.lua b/builtin/builtin.lua index 34477e6a..99242f3d 100644 --- a/builtin/builtin.lua +++ b/builtin/builtin.lua @@ -10,6 +10,12 @@ print = minetest.debug math.randomseed(os.time()) os.setlocale("C", "numeric") +local errorfct = error +error = function(text) + print(debug.traceback("")) + errorfct(text) +end + -- Load other files local modpath = minetest.get_modpath("__builtin") dofile(modpath.."/serialize.lua") diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index ab8dbe14..c5981caa 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -2,6 +2,12 @@ print = engine.debug math.randomseed(os.time()) os.setlocale("C", "numeric") +local errorfct = error +error = function(text) + print(debug.traceback("")) + errorfct(text) +end + local scriptpath = engine.get_scriptdir() mt_color_grey = "#AAAAAA"