Previous Topic

Next Topic

Error Handling

Most c-treeDB API functions return an error status to indicate if a particular function operation succeeded or not. Most c-treeDB API functions will also keep the last error status, if the function operation failed. The last error status can be manipulated with the following functions:

  • ctdbGetError() retrieves the last error status. If a function succeeds, the success status is not kept by the c-treeDB API.
  • ctdbSetError() sets the last error status, overwriting any previous error status kept by the c-treeDB API.
  • ctdbClearError() clears the last error status.
/* clear error if error is INOT_ERR */
if (ctdbGetError(AnyHandle) == INOT_ERR)
{
   ctdbClearError(AnyHandle);
}