From 5b518ed2feff28c9bf21ad940c1b211b72d71bd1 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 25 Aug 2013 12:54:16 +0200 Subject: [PATCH] Add backtrace to error function --- builtin/builtin.lua | 6 ++++++ builtin/mainmenu.lua | 6 ++++++ 2 files changed, 12 insertions(+) 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" -- 2.30.2