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/psphotReadoutCleanup.c

    r11184 r11263  
    11# include "psphot.h"
    22
     3// psphotReadoutCleanup is called on exit from psphotReadout if the last raised
     4// error is not a DATA error, then there was a serious problem.  only in this
     5// case, or if the fail on the stats measurement, do we return false
    36bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) {
     7
     8    psErrorCode err = psErrorCodeLast();
     9    if (err != PSPHOT_ERR_DATA) {
     10        return false;
     11    }
    412
    513    // use the psf-model to measure FWHM stats
    614    if (psf) {
     15        // don't call psphotPSFstats unless we have a valid pdf
     16        // if it fails, there is probably a programming error
    717        if (!psphotPSFstats (readout, recipe, psf)) {
    8             psError(PS_ERR_IO, true, "Failed to measure PSF shape parameters");
     18            psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters");
    919            return false;
    1020        }
    11     } else if (sources) {
     21    }
     22    if (!psf && sources) {
    1223        if (!psphotMomentsStats (readout, recipe, sources)) {
    13             psError(PS_ERR_IO, true, "Failed to measure Moment shape parameters");
     24            psError(PSPHOT_ERR_PROG, false, "Failed to measure Moment shape parameters");
    1425            return false;
    1526        }
Note: See TracChangeset for help on using the changeset viewer.