Error stack tracebacks?
tisba opened this issue · 0 comments
tisba commented
Hi there!
(little disclaimer first: I'm not terribly familiar with go)
I'm struggling a bit on how to get proper tracebacks for errors using go-lua.
Giving this hello.lua
file, containing:
print("Hello World")
function foo()
print("Hello, I'm foo!")
bar()
end
foo()
…run with lua hello.lua
gives me:
Hello World
Hello, I'm foo!
lua: hello.lua:5: attempt to call global 'bar' (a nil value)
stack traceback:
hello.lua:5: in function 'foo'
hello.lua:8: in main chunk
[C]: in ?
If I run this with the example provided in the README, I get:
go run lua-test.go
Hello World
Hello, I'm foo!
2017/08/03 11:38:42 runtime error: hello.lua:6: attempt to call a nil value
How can I get a comparable traceback with go-lua? Something that can be presented to a user. Are there more examples somewhere?