IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2007, 11:41:08 AM (19 years ago)
Author:
eugene
Message:

updating error handling to distinguish data errors from fatal errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotImageLoop.c

    r9566 r11263  
    11# include "psphot.h"
    22
    3 // XXX where do we load optional mask and weight input images?
     3// XXX the errors in the pmFPAfileIOChecks could also be due to a programming or config error
     4// XXX we need to either handle those errors or handle the error in pmFPAfileIOChecks and exit
    45bool psphotImageLoop (pmConfig *config) {
    56
     
    1112    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
    1213    if (!status) {
    13         psError(PS_ERR_IO, false, "Can't find input data!");
     14        psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
    1415        return false;
    1516    }
     
    1920    // files associated with the science image
    2021    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    21         psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in psphot\n");
     22        psError(PSPHOT_ERR_DATA, false, "failed IO for fpa in psphot\n");
    2223        psFree(view);
    2324        return false;
     
    2829        if (! chip->process || ! chip->file_exists) { continue; }
    2930        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    30             psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     31            psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in psphot\n", view->chip);
    3132            psFree (view);
    3233            return false;
     
    3738            if (! cell->process || ! cell->file_exists) { continue; }
    3839            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    39                 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
     40                psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
    4041                psFree (view);
    4142                return false;
     
    4546            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    4647                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    47                     psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     48                    psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
    4849                    psFree (view);
    4950                    return false;
     
    5455                // run the actual photometry analysis
    5556                if (!psphotReadout (config, view)) {
    56                     psError(PS_ERR_UNKNOWN, false, "failed psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     57                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    5758                    psFree (view);
    5859                    return false;
     
    6061
    6162                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    62                     psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     63                    psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
    6364                    psFree (view);
    6465                    return false;
     
    6667            }
    6768            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    68                 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
     69                psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
    6970                psFree (view);
    7071                return false;
     
    7273        }
    7374        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    74             psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     75            psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in psphot\n", view->chip);
    7576            psFree (view);
    7677            return false;
     
    7879    }
    7980    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    80         psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in psphot\n");
     81        psError(PSPHOT_ERR_DATA, false, "failed IO for fpa in psphot\n");
    8182        psFree (view);
    8283        return false;
Note: See TracChangeset for help on using the changeset viewer.