]> jfr.im git - irc/quakenet/newserv.git/blob - lua/lib/bootstrap.lua
CHANSERV: better batcher error handling for expired accounts/accounts with no email.
[irc/quakenet/newserv.git] / lua / lib / bootstrap.lua
1 require("lib/class")
2 require("lib/quakenet")
3 require("lib/missing")
4 require("lib/scheduler")
5 require("lib/schedule-legacy")
6 require("lib/serialise")
7 require("lib/country")
8 require("lib/db")
9 require("lib/socket")
10 require("lib/json")
11
12 local LASTERROR = 0
13 local NOTREPORTING = false
14
15 function scripterror(err)
16 local cerror = os.time()
17 if cerror > LASTERROR then
18 LASTERROR = cerror
19 NOTREPORTING = false
20 end
21
22 if not NOTREPORTING then
23 chanmsgn(traceback(err, 2))
24
25 LASTERROR = LASTERROR + 1
26 if LASTERROR > cerror + 10 then
27 NOTREPORTING = true
28 chanmsg("Too many errors for this script -- no longer reporting")
29 end
30 end
31 end
32
33 math.randomseed(os.time())