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:
MrPerson
2015-07-23 06:46:40 -07:00
parent 81145ea134
commit 471d69fcf7
22 changed files with 56 additions and 44 deletions

View File

@@ -2,12 +2,12 @@
//returns text as a string if these conditions are met
/proc/return_file_text(filename)
if(fexists(filename) == 0)
ERROR("File not found ([filename])")
throw EXCEPTION("return_file_text(): File not found")
return
var/text = file2text(filename)
if(!text)
ERROR("File empty ([filename])")
throw EXCEPTION("return_file_text(): File empty")
return
return text