From 2b480e50e69eb959485dd624efd60302ee383111 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 13 Jul 2022 10:08:23 -0400 Subject: [PATCH] feat: print tracebacks for errors --- lua.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua.go b/lua.go index d7eb823..92ece05 100644 --- a/lua.go +++ b/lua.go @@ -12,12 +12,16 @@ import ( rt "github.com/arnodel/golua/runtime" "github.com/arnodel/golua/lib" + "github.com/arnodel/golua/lib/debuglib" ) var minimalconf = `hilbish.prompt '& '` func luaInit() { l = rt.New(os.Stdout) + l.PushContext(rt.RuntimeContextDef{ + MessageHandler: debuglib.Traceback, + }) lib.LoadAll(l) lib.LoadLibs(l, hilbishLoader)