2
\$\begingroup\$

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

\$\endgroup\$
7
  • \$\begingroup\$ -1 Your question is unclear. \$\endgroup\$
    – Vaillancourt
    Jul 1, 2015 at 23:25
  • 1
    \$\begingroup\$ Which part? What are good practices to handle, show to client and manage exceptions - errors. For games. \$\endgroup\$ Jul 1, 2015 at 23:58
  • 1
    \$\begingroup\$ I debate that this is off topic. Game error reporting is much different than standard software error reporting. An answer: pc and console games by and large don't use exception handling, because they slow down execution. Often though, asserts are used in non release builds to help catch problems during development. Enums / defines are common ways of specifying error codes in the code. These codes are sometimes used by customer service to help the user diagnose problems, also as you say, they can map to localized strings. Codes don't give hints as to how the code works internally either. \$\endgroup\$
    – Alan Wolfe
    Jul 2, 2015 at 1:55
  • 1
    \$\begingroup\$ Games aren't the only thing that tend not use exceptions, it's a broadly-debated subject. Speaking of which, on-topicness aside, there's still no concrete question here that isn't asking for a discussion. This is probably better asked on GDNet. \$\endgroup\$
    – user1430
    Jul 2, 2015 at 4:45
  • \$\begingroup\$ "Game error reporting is much different than standard software error reporting." But the again @JoshPetrie describes question as "would a professional game developer give me a better/different/more specific answer to this question than other programmers?" If game development error handling is different, then it makes sense that professional game developer would give a better answer. While games tend not to use exceptions I can think of several examples where it should be a must. Couple months ago i wrote an authoritative server and client API - which might throw exception from sockets. \$\endgroup\$ Jul 2, 2015 at 10:11

0

Browse other questions tagged .