← Back to team overview

nrtb-core team mailing list archive

[Bug 725107] Re: Todo: (style) exception usage seems overly complex.

 

Fixes and adjustments made in version 38.

** Changed in: nrtb
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of NRTB
Core, which is subscribed to New Real Time Battle.
https://bugs.launchpad.net/bugs/725107

Title:
  Todo: (style) exception usage seems overly complex.

Status in The New Real Time Battle Project:
  Fix Committed

Bug description:
  In dbAccess.cpp, line 81 of revision 36 we find the following:

  	default:
  					throw bad_type("dbAccess::sqlExecute - Invalid query type used,");
  					break;
  	}

  Assuming the dbAccess::bad_type is only thrown in this context (a bad
  query type passed to dbAccess::sqlExecute()) it would be better if the
  exception name is changed to dbAccess::unknown_query_type. This would
  allow you construct and throw without loading a string (faster) and
  makes picking the exception off by type name in catch statements more
  clear.  The new code would be something like this:

  default:
                 {
                     throw unknown_query_type();
                 };

  };



References