From 35f3c582f2634720344f8590a8f0b08dbf6e0098 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 21 Oct 2017 03:47:34 -0500 Subject: [PATCH] [MIRROR] Hacky temp workaround of byond bug preventing logging of stack overflow runtimes (#3512) * 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! * Hacky temp workaround of byond bug preventing logging of stack overflow runtimes --- code/modules/error_handler/error_handler.dm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index 17ac8b3628..cb0eb7f40a 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -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 \ No newline at end of file +#endif