mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 00:27:00 +01:00
What the fuck is this
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
var/list/error_last_seen = list()
|
||||
// error_cooldown items will either be positive (cooldown time) or negative (silenced error)
|
||||
// If negative, starts at -1, and goes down by 1 each time that error gets skipped
|
||||
var/list/error_cooldown = list()
|
||||
var/total_runtimes = 0
|
||||
var/total_runtimes_skipped = 0
|
||||
GLOBAL_VAR_INIT(total_runtimes, GLOB.total_runtimes || 0)
|
||||
GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
|
||||
|
||||
// The ifdef needs to be down here, since the error viewer references total_runtimes
|
||||
#ifdef DEBUG
|
||||
/world/Error(var/exception/e, var/datum/e_src)
|
||||
if(!istype(e)) // Something threw an unusual exception
|
||||
log_error("\[[time_stamp()]] Uncaught exception: [e]")
|
||||
return ..()
|
||||
if(!error_last_seen) // A runtime is occurring too early in start-up initialization
|
||||
return ..()
|
||||
total_runtimes++
|
||||
var/static/list/error_last_seen = list()
|
||||
// error_cooldown items will either be positive (cooldown time) or negative (silenced error)
|
||||
// If negative, starts at -1, and goes down by 1 each time that error gets skipped
|
||||
var/static/list/error_cooldown = list()
|
||||
GLOB.total_runtimes++
|
||||
|
||||
var/erroruid = "[e.file][e.line]"
|
||||
var/last_seen = error_last_seen[erroruid]
|
||||
@@ -22,7 +21,7 @@ var/total_runtimes_skipped = 0
|
||||
last_seen = world.time
|
||||
if(cooldown < 0)
|
||||
error_cooldown[erroruid]-- // Used to keep track of skip count for this error
|
||||
total_runtimes_skipped++
|
||||
GLOB.total_runtimes_skipped++
|
||||
return // Error is currently silenced, skip handling it
|
||||
|
||||
// Handle cooldowns and silencing spammy errors
|
||||
|
||||
Reference in New Issue
Block a user