mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Change many ERROR() calls into thrown exceptions
This requires a 508 beta version to use. If Travis fails this he's a bitch Exceptions will generate a stack trace, which is way easier to see and more helpful in actually solving this kind of crap. Also logs all the arguments, src, line, and file automatically. Removed any dubiously helpful information in the exception names so the runtime condenser won't see each one as a different runtime. If the information is critical to solve these bugs (camera one maybe?), then I'll just make these warnings. Thrown exceptions crash the currently running proc. Yes that means there's useless returns in a bunch of these, sue me. spawn()'s are to let the proc continue. Almost all of these are difficult to trigger, but I did test playsound. And frankly even if they do cause bugs by crashing procs, big whoop
This commit is contained in:
@@ -10,8 +10,10 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
name = init_name
|
||||
switch(name)
|
||||
if("Removed",null,"")
|
||||
ERROR("invalid admin-rank name. datum deleted")
|
||||
del(src)
|
||||
spawn(-1)
|
||||
del(src)
|
||||
throw EXCEPTION("invalid admin-rank name")
|
||||
return
|
||||
if(init_rights) rights = init_rights
|
||||
if(!init_adds) init_adds = list()
|
||||
if(!init_subs) init_subs = list()
|
||||
@@ -178,7 +180,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
var/ckey = ckey(query.item[1])
|
||||
var/rank = ckeyEx(query.item[2])
|
||||
if(rank_names[rank] == null)
|
||||
error("Admin rank ([rank]) does not exist.")
|
||||
WARNING("Admin rank ([rank]) does not exist.")
|
||||
continue
|
||||
var/datum/admins/D = new(rank_names[rank], ckey) //create the admin datum and store it for later use
|
||||
if(!D) continue //will occur if an invalid rank is provided
|
||||
|
||||
@@ -582,8 +582,8 @@ var/list/admin_verbs_hideable = list(
|
||||
var/error_extra = ""
|
||||
if(!config.admin_legacy_system)
|
||||
error_extra = " Check mysql DB connection."
|
||||
error("Error while re-adminning [src], admin rank ([rank]) does not exist.[error_extra]")
|
||||
src << "Error while re-adminning, admin rank ([rank]) does not exist.[error_extra]"
|
||||
WARNING("Error while re-adminning [src], admin rank ([rank]) does not exist.[error_extra]")
|
||||
return
|
||||
D = new(rank_names[rank],ckey)
|
||||
var/client/C = directory[ckey]
|
||||
|
||||
@@ -16,12 +16,14 @@ var/list/admin_datums = list()
|
||||
|
||||
/datum/admins/New(datum/admin_rank/R, ckey)
|
||||
if(!ckey)
|
||||
ERROR("Admin datum created without a ckey argument. Datum has been deleted")
|
||||
del(src)
|
||||
spawn(-1)
|
||||
del(src)
|
||||
throw EXCEPTION("Admin datum created without a ckey")
|
||||
return
|
||||
if(!istype(R))
|
||||
ERROR("Admin datum created without a rank. Datum has been deleted")
|
||||
del(src)
|
||||
spawn(-1)
|
||||
del(src)
|
||||
throw EXCEPTION("Admin datum created without a rank")
|
||||
return
|
||||
rank = R
|
||||
admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
|
||||
@@ -130,7 +130,8 @@
|
||||
else
|
||||
src << "<span class='boldannounce'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>"
|
||||
ghostize()
|
||||
ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
|
||||
spawn(0)
|
||||
throw EXCEPTION("Borg MMI lacked a brainmob")
|
||||
mmi = null
|
||||
if(connected_ai)
|
||||
connected_ai.connected_robots -= src
|
||||
|
||||
@@ -155,7 +155,8 @@ Contents:
|
||||
Ninja.internals.icon_state = "internal1"
|
||||
|
||||
if(Ninja.mind != Mind) //something has gone wrong!
|
||||
ERROR("The ninja wasn't assigned the right mind. ;ç;")
|
||||
throw EXCEPTION("Ninja created with incorrect mind")
|
||||
return
|
||||
|
||||
Ninja << sound('sound/effects/ninja_greeting.ogg') //so ninja you probably wouldn't even know if you were made one
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ var/const/SIGNAL_COOLDOWN = 20 // 2 seconds
|
||||
var/obj/item/device/radio/hradio = S.server_radio
|
||||
|
||||
if(!hradio)
|
||||
ERROR("[src] has no radio.")
|
||||
throw EXCEPTION("tcombroadcast(): signal has no radio")
|
||||
return
|
||||
|
||||
if((!message) && message != 0)
|
||||
|
||||
@@ -221,7 +221,8 @@
|
||||
//call the shuttle to destination S
|
||||
/obj/docking_port/mobile/proc/request(obj/docking_port/stationary/S)
|
||||
if(canDock(S))
|
||||
ERROR("[type](\"[name]\") cannot dock at [S]\")")
|
||||
. = 1
|
||||
throw EXCEPTION("request(): shuttle cannot dock")
|
||||
return 1 //we can't dock at S
|
||||
|
||||
switch(mode)
|
||||
@@ -272,7 +273,7 @@
|
||||
/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1)
|
||||
. = canDock(S1)
|
||||
if(.)
|
||||
ERROR("[type](\"[name]\") cannot dock at [S1]")
|
||||
throw EXCEPTION("dock(): shuttle cannot dock")
|
||||
return .
|
||||
|
||||
if(canMove())
|
||||
|
||||
Reference in New Issue
Block a user