IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9239


Ignore:
Timestamp:
Oct 4, 2006, 1:06:15 PM (20 years ago)
Author:
jhoblitt
Message:

improve database error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/chiptool.c

    r9057 r9239  
    246246    psArray *output = p_psDBFetchResult(config->dbh);
    247247    if (!output) {
     248        psError(PS_ERR_UNKNOWN, false, "database error");
     249        return false;
     250    }
     251    if (!psArrayLength(output)) {
    248252        // XXX check psError here
    249         psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found");
     253        psError(PS_ERR_UNKNOWN, false, "no p2PendingImfile rows found");
     254        psFree(output);
    250255        return false;
    251256    }
     
    375380    psArray *output = p_psDBFetchResult(config->dbh);
    376381    if (!output) {
    377         // XXX check psError here and decide if we need to rollback or commit
     382        psError(PS_ERR_UNKNOWN, false, "database error");
     383        return false;
     384    }
     385    if (!psArrayLength(output)) {
     386        // XXX check psError here
    378387        psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found");
    379         // XXX temporarily returning true here as typically this wouldn't be a
    380         // fatal error.  false should be returned once psError() is fixed
    381         //return false;
     388        psFree(output);
    382389        return true;
    383390    }
Note: See TracChangeset for help on using the changeset viewer.