IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 17, 2010, 4:40:03 PM (16 years ago)
Author:
Paul Price
Message:

Reworked all ippTools to put fault=2 (SYS_ERROR) when can't find SQL file (presumably due to NFS problems). Removed DATA_ERROR because ippTools don't work on data (astronomical images or catalogues). This should allow us to turn on revert for fault=2 only.

File:
1 edited

Legend:

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

    r26943 r26981  
    104104    if (!psListLength(where->list)) {
    105105        psFree(where);
    106         psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     106        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    107107        return false;
    108108    }
     
    122122    psString bare_query = pxDataGet("addtool_find_cam_id.sql");
    123123    if (!bare_query) {
    124         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     124        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    125125        psFree(where);
    126126        return false;
    127127    }
    128128
    129     // prevent queueing an addRun if a given exposure has already been added to 
     129    // prevent queueing an addRun if a given exposure has already been added to
    130130    // the given dvo database
    131131    psString dvodb_string = NULL;
     
    238238        // queue the exp
    239239        if (!pxaddQueueByCamID(config,
    240                                row->cam_id,
    241                                workdir     ? workdir   : row->workdir,
    242                                reduction   ? reduction : row->reduction,
    243                                label       ? label     : row->label,
    244                                data_group  ? data_group : (row->data_group ? row->data_group :  (label ? label : row->label)),
    245                                dvodb       ? dvodb     : row->dvodb,
     240                               row->cam_id,
     241                               workdir     ? workdir   : row->workdir,
     242                               reduction   ? reduction : row->reduction,
     243                               label       ? label     : row->label,
     244                               data_group  ? data_group : (row->data_group ? row->data_group :  (label ? label : row->label)),
     245                               dvodb       ? dvodb     : row->dvodb,
    246246                               note        ? note      : NULL,
    247                                image_only
     247                               image_only
    248248        )) {
    249249            if (!psDBRollback(config->dbh)) {
     
    283283    if (!psListLength(where->list)) {
    284284        psFree(where);
    285         psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     285        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    286286        return false;
    287287    }
     
    303303
    304304    if ((!state) && (!label)) {
    305         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
     305        psError(PXTOOLS_ERR_CONFIG, false, "parameters are required");
    306306        psFree(where);
    307307        return false;
     
    346346    psString query = pxDataGet("addtool_find_pendingexp.sql");
    347347    if (!query) {
    348         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     348        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    349349        return false;
    350350    }
     
    412412    psString query = pxDataGet("addtool_find_pendingexp.sql");
    413413    if (!query) {
    414         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     414        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    415415        return false;
    416416    }
     
    454454        dtime_addstar,
    455455        path_base,
    456         fault
     456        fault
    457457        );
    458458
     
    506506        !psMetadataLookupBool(NULL, config->args, "-all")) {
    507507        psFree(where);
    508         psError(PXTOOLS_ERR_DATA, false, "search parameters (or -all) are required");
     508        psError(PXTOOLS_ERR_CONFIG, false, "search parameters (or -all) are required");
    509509        return false;
    510510    }
     
    512512    psString query = pxDataGet("addtool_find_processedexp.sql");
    513513    if (!query) {
    514         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     514        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    515515        return false;
    516516    }
     
    520520        psStringAppend(&query, " WHERE %s", whereClause);
    521521        psFree(whereClause);
    522     } 
     522    }
    523523
    524524    // we either add AND (condition) or WHERE (condition):
     
    526526        // list only faulted rows
    527527        psStringAppend(&query, " %s", " AND addProcessedExp.fault != 0");
    528     } 
     528    }
    529529    if (where->list && !faulted) {
    530530        // don't list faulted rows
     
    534534        // list only faulted rows
    535535        psStringAppend(&query, " %s", " WHERE addProcessedExp.fault != 0");
    536     } 
     536    }
    537537    if (!where->list && !faulted) {
    538538        // don't list faulted rows
     
    595595    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
    596596        psFree(where);
    597         psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     597        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    598598        return false;
    599599    }
     
    608608        psString query = pxDataGet("addtool_reset_faulted_runs.sql");
    609609        if (!query) {
    610             psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     610            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    611611            psFree(where);
    612612            return false;
     
    640640                psError(PS_ERR_UNKNOWN, false, "database error");
    641641            }
    642             psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     642            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    643643            psFree(where);
    644644            return false;
Note: See TracChangeset for help on using the changeset viewer.