← Back to team overview

nrtb-core team mailing list archive

[Bug 722705] Re: Todo: Several dbAccess:: methods improperly return a error flag

 

** Branch unlinked: lp:~gsjordanc/nrtb/data-broker

-- 
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/722705

Title:
  Todo: Several dbAccess:: methods improperly return a error flag

Status in The New Real Time Battle Project:
  Fix Committed

Bug description:
  Method int dbAccess::runSql (string scrpt) returns an int indicating
  success or failure and carrying no other significance. Best practices
  indicate that the method should succeed cleanly or throw an exception,
  therefore the return of a status flag is redundant; a failure would
  never return the error code in any case.

  Given the above, the method should be altered to not return any type
  of status code and to throw an exception (may I suggest
  dbAccess::runSql_failure as a name) should the query fail. A nice
  enhancement would be to store the error code and text in the exception
  so the actual event and problem can be resolved by the caller if
  needed.

  One other question while we are here, was the mis-spelling of "script"
  in the argument list intentional?



References