mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-21 07:42:21 +00:00
Improves caught exception logging
Also refactors away "log_runtime" config var to use its name for a helper proc
This commit is contained in:
@@ -102,3 +102,17 @@ var/total_runtimes_skipped = 0
|
||||
error_cache.logError(e, desclines, e_src = e_src)
|
||||
|
||||
#endif
|
||||
|
||||
/proc/log_runtime(exception/e, datum/e_src, extra_info)
|
||||
if(!istype(e))
|
||||
world.Error(e, e_src)
|
||||
return
|
||||
|
||||
if(extra_info)
|
||||
// Adding extra info adds two newlines, because parsing runtimes is funky
|
||||
if(islist(extra_info))
|
||||
e.desc = " [jointext(extra_info, "\n ")]\n\n" + e.desc
|
||||
else
|
||||
e.desc = " [extra_info]\n\n" + e.desc
|
||||
|
||||
world.Error(e, e_src)
|
||||
|
||||
@@ -109,7 +109,7 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
|
||||
hint = D.Destroy()
|
||||
catch(var/exception/e)
|
||||
if(istype(e))
|
||||
gcwarning("qdel() caught runtime destroying [D.type]: [e] in [e.file], line [e.line]")
|
||||
log_runtime(e, D, "Caught by qdel() destroying [D.type]")
|
||||
else
|
||||
gcwarning("qdel() caught runtime destroying [D.type]: [e]")
|
||||
// Destroy runtimed? Panic! Hard delete!
|
||||
@@ -169,7 +169,7 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
|
||||
Destroy()
|
||||
catch(var/exception/e)
|
||||
if(istype(e))
|
||||
gcwarning("Del() caught runtime destroying [type]: [e] in [e.file], line [e.line]")
|
||||
log_runtime(e, src, "Caught by Del() destroying [type]")
|
||||
else
|
||||
gcwarning("Del() caught runtime destroying [type]: [e]")
|
||||
if(del_profiling)
|
||||
|
||||
@@ -648,7 +648,7 @@
|
||||
newSnack.name = "Synthetic [newSnack.name]"
|
||||
custom_emote(2, "[pick("gibbers","drools","slobbers","claps wildly","spits")] as they vomit [newSnack] from their mouth!")
|
||||
catch(var/exception/e)
|
||||
log_to_dd("Cooking error: [e] in [e.file]:[e.line]")
|
||||
log_runtime(e, src, "Caught in SNPC cooking module")
|
||||
doing &= ~SNPC_SPECIAL
|
||||
// END COOKING MODULE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user