Skip to content

Commit

Permalink
Add backtrace to error function
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and kahrl committed Sep 4, 2013
1 parent af49033 commit 5b518ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/builtin.lua
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions builtin/mainmenu.lua
Expand Up @@ -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"
Expand Down

0 comments on commit 5b518ed

Please sign in to comment.