Skip to content

Instantly share code, notes, and snippets.

@britzl
Created April 2, 2014 16:15
Show Gist options
  • Select an option

  • Save britzl/9937367 to your computer and use it in GitHub Desktop.

Select an option

Save britzl/9937367 to your computer and use it in GitHub Desktop.
Example of how debug.traceback() works
local function a()
print(debug.traceback())
end
local function b()
a()
end
local function c()
b()
end
c()
--[[ Will output:
stack traceback:
traceback.lua:2: in function 'a'
traceback.lua:6: in function 'b'
traceback.lua:10: in function 'c'
traceback.lua:13: in main chunk
[C]: ?
--]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment