From 8c4dff3fc55d9f3bef61ee62e852c26baafa3ce1 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 12 Jun 2021 01:46:41 -0400 Subject: [PATCH] Only log, don't fatally exit --- scripting/eventloop/eventloop.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripting/eventloop/eventloop.go b/scripting/eventloop/eventloop.go index 59bfa7d..0158ec9 100644 --- a/scripting/eventloop/eventloop.go +++ b/scripting/eventloop/eventloop.go @@ -1,9 +1,9 @@ package eventloop import ( + log "github.com/sirupsen/logrus" lua "github.com/yuin/gopher-lua" luar "layeh.com/gopher-luar" - "log" "sync" "time" ) @@ -91,7 +91,6 @@ func (loop *EventLoop) schedule(repeating bool) int { if fn, ok := loop.vm.Get(1).(*lua.LFunction); ok { delay := loop.vm.CheckInt(2) - log.Println("Delay:", delay) var args []lua.LValue if loop.vm.GetTop() > 2 { args = make([]lua.LValue, loop.vm.GetTop()-2) @@ -110,7 +109,7 @@ func (loop *EventLoop) schedule(repeating bool) int { err := loop.vm.PCall(len(args), 0, fn) if err != nil { - log.Fatalln("Error calling function:", err) + log.WithError(err).Warning("Error calling lua function for timer") } } loop.jobCount++