summaryrefslogtreecommitdiff
path: root/lua.go
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-10-13 22:25:27 +0600
committerunwox <me@unwox.com>2025-10-13 22:25:27 +0600
commit06d94fe7f16e8985878a24332978731439599c4e (patch)
treebfecb440546167aa34575a1bed94c24f1bf59231 /lua.go
parentaadee458066c5d623ae2a16b8957f51418139fcd (diff)
fix error handling
Diffstat (limited to 'lua.go')
-rw-r--r--lua.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua.go b/lua.go
index b6d7027..11eec3e 100644
--- a/lua.go
+++ b/lua.go
@@ -293,12 +293,14 @@ func (l *Lua) GetGlobal(name string) {
}
func (l *Lua) NewThread(yield func(), resume func() bool) *Lua {
- return &Lua{
+ newl := &Lua{
l: C.lua_newthread(l.l),
running: l.running,
resume: resume,
yield: yield,
}
+ newl.PushGoFunction(TracebackHandler)
+ return newl
}
// TracebackHandler handles stack trace formatting on errors.