IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 25, 2010, 4:26:50 PM (16 years ago)
Author:
Paul Price
Message:

Reworking error codes to get consistent exit codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r27063 r27096  
    8484    psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSWARP_RECIPE);
    8585    if (!recipe) {
    86         psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
     86        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
    8787        return false;
    8888    }
    8989
    9090    if (!pswarpSetMaskBits(config)) {
    91         psError(PS_ERR_IO, false, "failed to set mask bits");
     91        psError(psErrorCodeLast(), false, "failed to set mask bits");
    9292        return NULL;
    9393    }
     
    111111
    112112    if (astrom->camera != input->camera) {
    113         psError(PS_ERR_UNKNOWN, true, "Input camera and astrometry camera do not match.");
     113        psError(PSWARP_ERR_DATA, true, "Input camera and astrometry camera do not match.");
    114114        return false;
    115115    }
     
    211211    if (bilevelAstrometry) {
    212212        if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) {
    213             psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA.");
     213            psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for input FPA.");
    214214            psFree(view);
    215215            psFree(stats);
     
    237237        if (bilevelAstrometry) {
    238238            if (!pmAstromReadBilevelChip (chip, hdu->header)) {
    239                 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input FPA.");
     239                psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for input FPA.");
    240240                psFree(view);
    241241                psFree(stats);
     
    245245            // we use a default FPA pixel scale of 1.0
    246246            if (!pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0)) {
    247                 psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input FPA.");
     247                psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for input FPA.");
    248248                psFree(view);
    249249                psFree(stats);
     
    312312
    313313    if (!pswarpPixelsLit(output, stats, config)) {
    314         psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions.");
     314        psError(psErrorCodeLast(), false, "Unable to calculate pixel regions.");
    315315        psFree(cells);
    316316        psFree(view);
     
    349349
    350350    if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) {
    351         psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts.");
     351        psError(psErrorCodeLast(), false, "Unable to average cell concepts.");
    352352        psFree(stats);
    353353        psFree(cells);
     
    361361
    362362    if (!psMetadataCopy(outFPA->concepts, input->fpa->concepts)) {
    363         psError(PS_ERR_UNKNOWN, false, "Unable to copy FPA concepts from input to output.");
     363        psError(psErrorCodeLast(), false, "Unable to copy FPA concepts from input to output.");
    364364        psFree(stats);
    365365        psFree(view);
     
    388388        pmHDU *skyHDU = pmHDUFromCell(cell); ///< HDU
    389389        if (!skyHDU) {
    390             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find skycell HDU.");
     390            psError(PSWARP_ERR_DATA, false, "Unable to find skycell HDU.");
    391391            psFree(view);
    392392            return false;
     
    398398
    399399    if (!pmAstromWriteWCS(hdu->header, outFPA, outChip, WCS_NONLIN_TOL)) {
    400         psError(PS_ERR_UNKNOWN, false, "Unable to generate WCS header.");
     400        psError(psErrorCodeLast(), false, "Unable to generate WCS header.");
    401401        psFree(stats);
    402402        return false;
     
    428428        psArray *sources = psphotLoadPSFSources (config, view);
    429429        if (!sources) {
    430             psError(PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF");
     430            psError(psErrorCodeLast(), false, "No sources supplied to measure PSF");
    431431            return false;
    432432        }
Note: See TracChangeset for help on using the changeset viewer.