From 58d6477d4b07033e0948c57d9ddf7852a0e4dcab Mon Sep 17 00:00:00 2001 From: Linventif Date: Sun, 10 Mar 2024 03:40:45 +0100 Subject: [PATCH] fix: if error in the start then wait 1 sec and retry --- lua/gmod_integration/shared/sh_errors.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/gmod_integration/shared/sh_errors.lua b/lua/gmod_integration/shared/sh_errors.lua index ad97d81..95c8359 100644 --- a/lua/gmod_integration/shared/sh_errors.lua +++ b/lua/gmod_integration/shared/sh_errors.lua @@ -4,7 +4,18 @@ function gmInte.sendLuaErrorReport(err, realm, stack, name, id, uptime) if (name != "gmod_integration") then return end - if (SERVER && math.Round(RealTime()) == 0) then return timer.Simple(1, function() gmInte.sendLuaErrorReport(err, realm, stack, name, id, math.Round(RealTime())) end) end + + if (SERVER && math.Round(RealTime()) == 0) then + return timer.Simple(1, function() + gmInte.sendLuaErrorReport(err, realm, stack, name, id, math.Round(RealTime())) + end) + end + + if (CLIENT && (!IsValid(LocalPlayer()) || !gmInte.config.token)) then + return timer.Simple(1, function() + gmInte.sendLuaErrorReport(err, realm, stack, name, id, math.Round(RealTime())) + end) + end gmInte.http.post("/errors", {