Hacky temp workaround of byond bug preventing logging of stack overflow runtimes (#31900)

* Workaround bug preventing logging of stack overflow runtimes

* I APOLOGIZE FOR NOTHING!
This commit is contained in:
Kyle Spier-Swenson
2017-10-19 14:13:48 -07:00
committed by oranges
parent 376afc85f4
commit 71b37be699

View File

@@ -6,6 +6,19 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
if(!istype(E)) //Something threw an unusual exception
log_world("\[[time_stamp()]] Uncaught exception: [E]")
return ..()
//this is snowflake because of a byond bug (ID:2306577), do not attempt to call non-builtin procs in this if
if(copytext(E.name,1,32) == "Maximum recursion level reached")
var/list/split = splittext(E.desc, "\n")
for (var/i in 1 to split.len)
if (split[i] != "")
split[i] = "\[[time2text(world.timeofday,"hh:mm:ss")]\][split[i]]"
E.desc = jointext(split, "\n")
//log to world while intentionally triggering the byond bug.
log_world("\[[time2text(world.timeofday,"hh:mm:ss")]\]runtime error: [E.name]\n[E.desc]")
//if we got to here without silently ending, the byond bug has been fixed.
log_world("The bug with recursion runtimes has been fixed. Please remove the snowflake check from world/Error in [__FILE__]:[__LINE__]")
return //this will never happen.
var/static/list/error_last_seen = list()
var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error)
@@ -118,4 +131,4 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
world.log = null
#endif
#endif