Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,7 @@
#include "code\game\verbs\who.dm"
#include "code\js\byjax.dm"
#include "code\js\menus.dm"
#include "code\modules\http.dm"
#include "code\modules\aberrants\_defines.dm"
#include "code\modules\aberrants\_modification.dm"
#include "code\modules\aberrants\organs\holders.dm"
Expand Down Expand Up @@ -1823,6 +1824,7 @@
#include "code\modules\emoji\emoji_parse.dm"
#include "code\modules\error_handler\error_handler.dm"
#include "code\modules\error_handler\error_viewer.dm"
#include "code\modules\error_handler\glitchtip.dm"
#include "code\modules\examine\examine.dm"
#include "code\modules\flufftext\Dreaming.dm"
#include "code\modules\flufftext\TextFilters.dm"
Expand Down Expand Up @@ -2860,7 +2862,6 @@
#include "code\modules\telesci\circuits.dm"
#include "code\modules\telesci\telepads.dm"
#include "code\modules\telesci\telesci_computer.dm"
#include "code\modules\text_to_speech\tts_html.dm"
#include "code\modules\text_to_speech\tts_main.dm"
#include "code\modules\tgchat\message.dm"
#include "code\modules\tgchat\to_chat.dm"
Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ var/next_station_date_change = 1 DAYS
var/time_string = time2text(world.timeofday, format)
return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string

/proc/time_stamp_metric()
var/date_portion = time2text(world.timeofday, "YYYY-MM-DD")
var/time_portion = time2text(world.timeofday, "hh:mm:ss")
return "[date_portion]T[time_portion]"

//Returns the world time in english
/proc/worldtime2text(time = world.time, timeshift = 1)
if(!roundstart_hour) roundstart_hour = rand(0, 23)
Expand Down
21 changes: 21 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,27 @@

/datum/config_entry/flag/log_world_topic


/*****************/
/*ERROR REPORTING*/
/*****************/

/datum/config_entry/string/glitchtip_dsn
config_entry_value = ""

/datum/config_entry/string/glitchtip_dsn/ValidateAndSet(str_val)
var/dsn_clean = replacetext(replacetext(str_val, "http://", ""), "https://", "")
var/at_pos = findtext(dsn_clean, "@")
var/slash_pos = findtext(dsn_clean, "/", at_pos)

if(!at_pos || !slash_pos)
return FALSE
return ..()

/datum/config_entry/string/glitchtip_environment
config_entry_value = "production"


/*****************/
/* VOTES */
/*****************/
Expand Down
8 changes: 4 additions & 4 deletions code/datums/topic/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,14 @@
require_perms = list(R_DEBUG)

/datum/admin_topic/viewruntime/Run(list/input)
var/datum/ErrorViewer/error_viewer = locate(input["viewruntime"])
var/datum/error_viewer/error_viewer = locate(input["viewruntime"])
if(!istype(error_viewer))
to_chat(usr, span_warning("That runtime viewer no longer exists."))
to_chat(usr.client, span_warning("That runtime viewer no longer exists."))
return
if(input["viewruntime_backto"])
error_viewer.showTo(usr, locate(input["viewruntime_backto"]), input["viewruntime_linear"])
error_viewer.show_to(usr.client, locate(input["viewruntime_backto"]), input["viewruntime_linear"])
else
error_viewer.showTo(usr, null, input["viewruntime_linear"])
error_viewer.show_to(usr.client, null, input["viewruntime_linear"])


/datum/admin_topic/admincaster
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
set category = "Debug"
set name = "View Runtimes"
set desc = "Open the Runtime Viewer"
GLOB.error_cache.showTo(usr)
GLOB.error_cache.show_to(src)

/client/proc/spawn_disciple()
set category = "Debug"
Expand Down
17 changes: 9 additions & 8 deletions code/modules/error_handler/error_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
#ifdef USE_CUSTOM_ERROR_HANDLER
#define ERROR_USEFUL_LEN 2

var/regex/stack_workaround = regex("[WORKAROUND_IDENTIFIER](.+?)[WORKAROUND_IDENTIFIER]")
var/list/error_last_seen = list()
var/list/error_cooldown = 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*/

/world/Error(exception/E, datum/e_src)
GLOB.total_runtimes++

Expand All @@ -26,19 +21,24 @@ var/list/error_cooldown = list() /* Error_cooldown items will either be positive

else if(copytext(E.name, 1, 18) == "Out of resources!")//18 == length() of that string + 1
log_world("BYOND out of memory. Restarting ([E?.file]:[E?.line])")
// SSplexora.notify_shutdown(PLEXORA_SHUTDOWN_KILLDD)
TgsEndProcess()
. = ..()
Reboot(reason = 1)
return

var/static/regex/stack_workaround = regex("[WORKAROUND_IDENTIFIER](.+?)[WORKAROUND_IDENTIFIER]")
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)
If negative, starts at -1, and goes down by 1 each time that error gets skipped*/

if(!error_last_seen) // A runtime is occurring too early in start-up initialization
return ..()

if(!islist(error_last_seen))
return ..() //how the fuck?

if(stack_workaround?.Find(E.name))
if(stack_workaround.Find(E.name))
var/list/data = json_decode(stack_workaround.group[1])
E.file = data[1]
E.line = data[2]
Expand Down Expand Up @@ -90,7 +90,7 @@ var/list/error_cooldown = list() /* Error_cooldown items will either be positive
error_cooldown[erroruid] = 0
if(skipcount > 0)
SEND_TEXT(world.log, "\[[time_stamp()]] Skipped [skipcount] runtimes in [E.file],[E.line].")
GLOB.error_cache.logError(E, skipCount = skipcount)
GLOB.error_cache.log_error(E, skip_count = skipcount)

error_last_seen[erroruid] = world.time
error_cooldown[erroruid] = cooldown
Expand Down Expand Up @@ -139,7 +139,7 @@ var/list/error_cooldown = list() /* Error_cooldown items will either be positive
if(silencing)
desclines += " (This error will now be silenced for [DisplayTimeText(configured_error_silence_time)])"
if(GLOB.error_cache)
GLOB.error_cache.logError(E, desclines)
GLOB.error_cache.log_error(E, desclines)

var/main_line = "\[[time_stamp()]] Runtime in [E.file],[E.line]: [E]"
SEND_TEXT(world.log, main_line)
Expand All @@ -162,6 +162,7 @@ var/list/error_cooldown = list() /* Error_cooldown items will either be positive
"name" = "[E.name]",
"desc" = "[E.desc]"
))
send_to_glitchtip(E)
#endif

#undef ERROR_USEFUL_LEN
Loading
Loading