Skip to content

Commit 5b518ed

Browse files
sapierkahrl
sapier
authored andcommittedSep 4, 2013
Add backtrace to error function
1 parent af49033 commit 5b518ed

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎builtin/builtin.lua

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ print = minetest.debug
1010
math.randomseed(os.time())
1111
os.setlocale("C", "numeric")
1212

13+
local errorfct = error
14+
error = function(text)
15+
print(debug.traceback(""))
16+
errorfct(text)
17+
end
18+
1319
-- Load other files
1420
local modpath = minetest.get_modpath("__builtin")
1521
dofile(modpath.."/serialize.lua")

‎builtin/mainmenu.lua

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ print = engine.debug
22
math.randomseed(os.time())
33
os.setlocale("C", "numeric")
44

5+
local errorfct = error
6+
error = function(text)
7+
print(debug.traceback(""))
8+
errorfct(text)
9+
end
10+
511
local scriptpath = engine.get_scriptdir()
612

713
mt_color_grey = "#AAAAAA"

0 commit comments

Comments
 (0)
Please sign in to comment.