I've seen games crash and throw errors. Usually games don't throw raw exception message, but codename error names, such as F204 or similar. I would like to know some thought about that.
Also, as i understand they separate errors in non critical on which maybe some message is shown and there are critical on which game is shut down and error window pops up.
Example, this is how i see it
//Some actions
try{
Bone bone = character.bones.Get(5);
}catch(ArgumentOutOfRangeException e){
//show error - stack trace, message, or code name error
ExceptionHandler(e.ToString(), ErrorType.CRITICAL); //handles
//also could be, or similar
ExceptionHandler("V401", ErrorType.CRITICAL); //handles, this is shown in game
}
public Bone Get(int index){
if (index < 0 || index >= _someData.Length) throw new ArgumentOutOfRangeException("Index is out of range.");
return _someData[index];
}
I think product users should not really see any exception logs but rather code names. But what are the suggested management for this - error string manual pass like it did (but i don't think its manageable), constant in separate class, enums?
Edit: Of course, having an error codename catalog would make the life easier for the devs themselves. If user submits an error, they can find the spot quite quickly. Does this made any sense?
Thanks