]>
Commit | Line | Data |
---|---|---|
72054e5b | 1 | require("lib/class") |
a098bb43 CP |
2 | require("lib/quakenet") |
3 | require("lib/missing") | |
72054e5b CP |
4 | require("lib/scheduler") |
5 | require("lib/schedule-legacy") | |
a098bb43 CP |
6 | require("lib/serialise") |
7 | require("lib/country") | |
8 | require("lib/db") | |
9 | require("lib/socket") | |
10 | require("lib/json") | |
a098bb43 CP |
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()) |