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

    r26896 r27096  
    4949    {
    5050        if (!pmFPAReadHeaderSet(skycell->fpa, skycell->fits, config)) {
    51             psError(PS_ERR_UNKNOWN, false, "Unable to read headers for skycell.");
     51            psError(psErrorCodeLast(), false, "Unable to read headers for skycell.");
    5252            psFree(view);
    5353            return false;
     
    5959        pmHDU *hdu = pmHDUFromCell(source); ///< HDU for source
    6060        if (!hdu || !hdu->header) {
    61             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find header for sky cell.");
     61            psError(PM_ERR_PROG, false, "Unable to find header for sky cell.");
    6262            psFree(view);
    6363            return false;
     
    6565        int numCols = psMetadataLookupS32(NULL, hdu->header, "NAXIS1"); ///< Number of columns
    6666        int numRows = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); ///< Number of rows
    67         if ((numCols == 0) || (numRows == 0)) {
    68             psError(PS_ERR_UNKNOWN, false, "skycell has invalid dimensions %d x %d", numCols, numRows);
     67        if ((numCols == 0) || (numRows == 0)) {
     68            psError(PSWARP_ERR_DATA, false, "skycell has invalid dimensions %d x %d", numCols, numRows);
    6969            psFree(view);
    7070            return false;
     
    7777        psFree(readout);                // Drop reference
    7878
    79         bool status = false;
     79        bool status = false;
    8080        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XBIN");
    8181        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YBIN");
     
    106106    if (bilevelAstrometry) {
    107107        if (!pmAstromReadBilevelMosaic(output->fpa, phu->header)) {
    108             psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for skycell.");
     108            psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for skycell.");
    109109            psFree(view);
    110110            return false;
    111111        }
    112112        if (!pmAstromReadBilevelChip(outputChip, hdu->header)) {
    113             psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for skycell.");
     113            psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for skycell.");
    114114            psFree(view);
    115115            return false;
     
    118118        // we use a default FPA pixel scale of 1.0
    119119        if (!pmAstromReadWCS(output->fpa, outputChip, hdu->header, 1.0)) {
    120             psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for skycell.");
     120            psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for skycell.");
    121121            psFree(view);
    122122            return false;
Note: See TracChangeset for help on using the changeset viewer.