IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6131


Ignore:
Timestamp:
Jan 21, 2006, 1:27:12 PM (20 years ago)
Author:
jhoblitt
Message:

add db error checking

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r6063 r6131  
    33
    44// select pending frames (exposure+images) which are done/not done
    5 bool p2insertDoneFrames (p2Config *config, psArray *doneFrames) {
     5bool p2insertDoneFrames(p2Config *config, psArray *doneFrames) {
    66
    77    for (int i = 0; i < doneFrames->n; i++) {
     
    1111        psArray *doneImages = doneFrame->images;
    1212       
    13         p2DoneExpInsertObject(config->database, doneExposure);
     13        if (!p2DoneExpInsertObject(config->database, doneExposure)) {
     14            psError(PS_ERR_UNKNOWN, false, "database access failed");
     15            return false;
     16        }
    1417
    1518        for (int i = 0; i < doneImages->n; i++) {
    16             p2DoneImfileInsertObject(config->database, doneImages->data[i]);
     19            if (!p2DoneImfileInsertObject(config->database, doneImages->data[i])) {
     20            psError(PS_ERR_UNKNOWN, false, "database access failed");
     21            return false;
     22            }
    1723        }
    1824    }
  • trunk/ippTools/src/p2insertPendingFrames.c

    r6111 r6131  
    66// NOTE this function converts the rawFrames to pendingFrames AND inserts them
    77//      this is useful since the table must be locked the whole time, to get the versions
    8 bool p2insertPendingFrames (p2Config *config, psArray *rawFrames) {
     8bool p2insertPendingFrames(p2Config *config, psArray *rawFrames) {
    99
    1010    psMetadata *where = psMetadataAlloc();
     
    5858        }
    5959       
    60         p2PendingExpInsertObject(config->database, pendingExposure);
     60        if (!p2PendingExpInsertObject(config->database, pendingExposure)) {
     61            psError(PS_ERR_UNKNOWN, false, "database access failed");
     62            return false;
     63        }
    6164
    6265        for (int i = 0; i < pendingImages->n; i++) {
    63                 p2PendingImfileInsertObject(config->database,
    64                     pendingImages->data[i]);
     66            if (!p2PendingImfileInsertObject(config->database,
     67                    pendingImages->data[i])) {
     68                psError(PS_ERR_UNKNOWN, false, "database access failed");
     69                return false;
     70            }
    6571        }
    6672    }
Note: See TracChangeset for help on using the changeset viewer.