diff --git a/[core]/cron/server/main.lua b/[core]/cron/server/main.lua index 51da085d..7044069d 100644 --- a/[core]/cron/server/main.lua +++ b/[core]/cron/server/main.lua @@ -38,7 +38,10 @@ function OnTime(timestamp) if timestamp >= scheduledTimestamp and (not lastTimestamp or lastTimestamp < scheduledTimestamp) then local d = os.date('*t', scheduledTimestamp).wday - cronJobs[i].cb(d, cronJobs[i].h, cronJobs[i].m) + + if not pcall(cronJobs[i].cb, d, cronJobs[i].h, cronJobs[i].m) then + print(("[^1ERROR^7] cron job at ^5%02d:%02d^7 errored, skipping it"):format(cronJobs[i].h, cronJobs[i].m)) + end end end end