Replaces EXCEPTION() with stack_trace() and CRASH()

This commit is contained in:
Ghommie
2020-03-05 01:47:04 +01:00
parent 7a539d0a78
commit bb7bfc04cc
18 changed files with 24 additions and 33 deletions

View File

@@ -63,7 +63,7 @@
//Sleeping in here prevents future fires until returned. //Sleeping in here prevents future fires until returned.
/datum/controller/subsystem/proc/fire(resumed = 0) /datum/controller/subsystem/proc/fire(resumed = 0)
flags |= SS_NO_FIRE flags |= SS_NO_FIRE
throw EXCEPTION("Subsystem [src]([type]) does not fire() but did not set the SS_NO_FIRE flag. Please add the SS_NO_FIRE flag to any subsystem that doesn't fire so it doesn't get added to the processing list and waste cpu.") CRASH("Subsystem [src]([type]) does not fire() but did not set the SS_NO_FIRE flag. Please add the SS_NO_FIRE flag to any subsystem that doesn't fire so it doesn't get added to the processing list and waste cpu.")
/datum/controller/subsystem/Destroy() /datum/controller/subsystem/Destroy()
dequeue() dequeue()

View File

@@ -83,15 +83,15 @@ SUBSYSTEM_DEF(jukeboxes)
return return
for(var/list/jukeinfo in activejukeboxes) for(var/list/jukeinfo in activejukeboxes)
if(!jukeinfo.len) if(!jukeinfo.len)
EXCEPTION("Active jukebox without any associated metadata.") stack_trace("Active jukebox without any associated metadata.")
continue continue
var/datum/track/juketrack = jukeinfo[1] var/datum/track/juketrack = jukeinfo[1]
if(!istype(juketrack)) if(!istype(juketrack))
EXCEPTION("Invalid jukebox track datum.") stack_trace("Invalid jukebox track datum.")
continue continue
var/obj/jukebox = jukeinfo[3] var/obj/jukebox = jukeinfo[3]
if(!istype(jukebox)) if(!istype(jukebox))
EXCEPTION("Nonexistant or invalid object associated with jukebox.") stack_trace("Nonexistant or invalid object associated with jukebox.")
continue continue
var/sound/song_played = sound(juketrack.song_path) var/sound/song_played = sound(juketrack.song_path)
var/area/currentarea = get_area(jukebox) var/area/currentarea = get_area(jukebox)

View File

@@ -185,14 +185,13 @@ SUBSYSTEM_DEF(shuttle)
WARNING("requestEvac(): There is no emergency shuttle, but the \ WARNING("requestEvac(): There is no emergency shuttle, but the \
shuttle was called. Using the backup shuttle instead.") shuttle was called. Using the backup shuttle instead.")
if(!backup_shuttle) if(!backup_shuttle)
throw EXCEPTION("requestEvac(): There is no emergency shuttle, \ CRASH("requestEvac(): There is no emergency shuttle, \
or backup shuttle! The game will be unresolvable. This is \ or backup shuttle! The game will be unresolvable. This is \
possibly a mapping error, more likely a bug with the shuttle \ possibly a mapping error, more likely a bug with the shuttle \
manipulation system, or badminry. It is possible to manually \ manipulation system, or badminry. It is possible to manually \
resolve this problem by loading an emergency shuttle template \ resolve this problem by loading an emergency shuttle template \
manually, and then calling register() on the mobile docking port. \ manually, and then calling register() on the mobile docking port. \
Good luck.") Good luck.")
return
emergency = backup_shuttle emergency = backup_shuttle
var/srd = CONFIG_GET(number/shuttle_refuel_delay) var/srd = CONFIG_GET(number/shuttle_refuel_delay)
if(world.time - SSticker.round_start_time < srd) if(world.time - SSticker.round_start_time < srd)
@@ -420,7 +419,7 @@ SUBSYSTEM_DEF(shuttle)
/datum/controller/subsystem/shuttle/proc/request_transit_dock(obj/docking_port/mobile/M) /datum/controller/subsystem/shuttle/proc/request_transit_dock(obj/docking_port/mobile/M)
if(!istype(M)) if(!istype(M))
throw EXCEPTION("[M] is not a mobile docking port") CRASH("[M] is not a mobile docking port")
if(M.assigned_transit) if(M.assigned_transit)
return return

View File

@@ -11,7 +11,7 @@
/datum/progressbar/New(mob/User, goal_number, atom/target) /datum/progressbar/New(mob/User, goal_number, atom/target)
. = ..() . = ..()
if (!istype(target)) if (!istype(target))
EXCEPTION("Invalid target given") CRASH("Invalid target given")
if (goal_number) if (goal_number)
goal = goal_number goal = goal_number
bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0", HUD_LAYER) bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0", HUD_LAYER)

View File

@@ -746,7 +746,7 @@
Mind.add_antag_datum(ninjadatum) Mind.add_antag_datum(ninjadatum)
if(Ninja.mind != Mind) //something has gone wrong! if(Ninja.mind != Mind) //something has gone wrong!
throw EXCEPTION("Ninja created with incorrect mind") stack_trace("Ninja created with incorrect mind")
message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by dynamic.") message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by dynamic.")
log_game("[key_name(Ninja)] was spawned as a ninja by dynamic.") log_game("[key_name(Ninja)] was spawned as a ninja by dynamic.")

View File

@@ -1,7 +1,6 @@
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, soundenvwet = -10000, soundenvdry = 0) /proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, soundenvwet = -10000, soundenvdry = 0)
if(isarea(source)) if(isarea(source))
throw EXCEPTION("playsound(): source is an area") CRASH("playsound(): source is an area")
return
var/turf/turf_source = get_turf(source) var/turf/turf_source = get_turf(source)

View File

@@ -23,8 +23,7 @@ GLOBAL_PROTECT(protected_ranks)
name = init_name name = init_name
if(!name) if(!name)
qdel(src) qdel(src)
throw EXCEPTION("Admin rank created without name.") CRASH("Admin rank created without name.")
return
if(init_rights) if(init_rights)
rights = init_rights rights = init_rights
include_rights = rights include_rights = rights

View File

@@ -39,12 +39,10 @@ GLOBAL_PROTECT(href_token)
return return
if(!ckey) if(!ckey)
QDEL_IN(src, 0) QDEL_IN(src, 0)
throw EXCEPTION("Admin datum created without a ckey") CRASH("Admin datum created without a ckey")
return
if(!istype(R)) if(!istype(R))
QDEL_IN(src, 0) QDEL_IN(src, 0)
throw EXCEPTION("Admin datum created without a rank") CRASH("Admin datum created without a rank")
return
target = ckey target = ckey
name = "[ckey]'s admin datum ([R])" name = "[ckey]'s admin datum ([R])"
rank = R rank = R

View File

@@ -303,8 +303,7 @@
/obj/structure/blob/proc/change_to(type, controller) /obj/structure/blob/proc/change_to(type, controller)
if(!ispath(type)) if(!ispath(type))
throw EXCEPTION("change_to(): invalid type for blob") CRASH("change_to(): invalid type for blob")
return
var/obj/structure/blob/B = new type(src.loc, controller) var/obj/structure/blob/B = new type(src.loc, controller)
B.creation_action() B.creation_action()
B.update_icon() B.update_icon()

View File

@@ -81,7 +81,7 @@
if(istype(our_target, /datum/cellular_emporium)) if(istype(our_target, /datum/cellular_emporium))
cellular_emporium = our_target cellular_emporium = our_target
else else
throw EXCEPTION("cellular_emporium action created with non emporium") CRASH("cellular_emporium action created with non emporium")
/datum/action/innate/cellular_emporium/Activate() /datum/action/innate/cellular_emporium/Activate()
cellular_emporium.ui_interact(owner) cellular_emporium.ui_interact(owner)

View File

@@ -477,7 +477,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
if(SOULVALUE >= ARCH_THRESHOLD && ascendable) if(SOULVALUE >= ARCH_THRESHOLD && ascendable)
A.convert_to_archdevil() A.convert_to_archdevil()
else else
throw EXCEPTION("Unable to find a blobstart landmark for hellish resurrection") CRASH("Unable to find a blobstart landmark for hellish resurrection")
/datum/antagonist/devil/proc/update_hud() /datum/antagonist/devil/proc/update_hud()

View File

@@ -144,7 +144,7 @@
for(var/i in 1 to device_type) for(var/i in 1 to device_type)
var/datum/pipeline/parent = parents[i] var/datum/pipeline/parent = parents[i]
if(!parent) if(!parent)
throw EXCEPTION("Component is missing a pipenet! Rebuilding...") stack_trace("Component is missing a pipenet! Rebuilding...")
build_network() build_network()
parent.update = 1 parent.update = 1

View File

@@ -23,7 +23,7 @@
return return
template = SSmapping.shelter_templates[template_id] template = SSmapping.shelter_templates[template_id]
if(!template) if(!template)
throw EXCEPTION("Shelter template ([template_id]) not found!") stack_trace("Shelter template ([template_id]) not found!")
qdel(src) qdel(src)
/obj/item/survivalcapsule/Destroy() /obj/item/survivalcapsule/Destroy()

View File

@@ -657,8 +657,7 @@ GLOBAL_LIST_EMPTY(allCasters)
var/mob/living/silicon/ai_user = user var/mob/living/silicon/ai_user = user
scanned_user = "[ai_user.name] ([ai_user.job])" scanned_user = "[ai_user.name] ([ai_user.job])"
else else
throw EXCEPTION("Invalid user for this proc") CRASH("Invalid user for this proc")
return
/obj/machinery/newscaster/proc/print_paper() /obj/machinery/newscaster/proc/print_paper()
SSblackbox.record_feedback("amount", "newspapers_printed", 1) SSblackbox.record_feedback("amount", "newspapers_printed", 1)

View File

@@ -69,7 +69,7 @@ Contents:
Mind.add_antag_datum(ninjadatum) Mind.add_antag_datum(ninjadatum)
if(Ninja.mind != Mind) //something has gone wrong! if(Ninja.mind != Mind) //something has gone wrong!
throw EXCEPTION("Ninja created with incorrect mind") stack_trace("Ninja created with incorrect mind")
spawned_mobs += Ninja spawned_mobs += Ninja
message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by an event.") message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by an event.")

View File

@@ -570,8 +570,7 @@
else if (istype(W, /obj/item/stack/cable_coil) && opened) else if (istype(W, /obj/item/stack/cable_coil) && opened)
var/turf/host_turf = get_turf(src) var/turf/host_turf = get_turf(src)
if(!host_turf) if(!host_turf)
throw EXCEPTION("attackby on APC when it's not on a turf") CRASH("attackby on APC when it's not on a turf")
return
if (host_turf.intact) if (host_turf.intact)
to_chat(user, "<span class='warning'>You must remove the floor plating in front of the APC first!</span>") to_chat(user, "<span class='warning'>You must remove the floor plating in front of the APC first!</span>")
return return

View File

@@ -78,12 +78,12 @@ in their list
/proc/list_to_object(var/list/data, var/loc) /proc/list_to_object(var/list/data, var/loc)
if(!islist(data)) if(!islist(data))
throw EXCEPTION("You didn't give me a list, bucko") stack_trace("You didn't give me a list, bucko")
if(!("type" in data)) if(!("type" in data))
throw EXCEPTION("No 'type' field in the data") stack_trace("No 'type' field in the data")
var/path = text2path(data["type"]) var/path = text2path(data["type"])
if(!path) if(!path)
throw EXCEPTION("Path not found: [path]") stack_trace("Path not found: [path]")
var/atom/movable/thing = new path(loc) var/atom/movable/thing = new path(loc)
thing.deserialize(data) thing.deserialize(data)

View File

@@ -14,8 +14,7 @@ GLOBAL_PROTECT(mentor_href_token)
/datum/mentors/New(ckey) /datum/mentors/New(ckey)
if(!ckey) if(!ckey)
QDEL_IN(src, 0) QDEL_IN(src, 0)
throw EXCEPTION("Mentor datum created without a ckey") CRASH("Mentor datum created without a ckey")
return
target = ckey(ckey) target = ckey(ckey)
name = "[ckey]'s mentor datum" name = "[ckey]'s mentor datum"
href_token = GenerateToken() href_token = GenerateToken()