IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2006, 3:02:08 PM (20 years ago)
Author:
Paul Price
Message:

Applying RHL patch. Generally improves the error handling and traceback. pmConcepts.c and pmConceptsRead.c done by PAP (RHL did this also, but I had already done them). Resolved conflicts, except for pmFPAfile.c, which uses psAbort in some instances where RHL's patch had psError; leave this for Gene to decide.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r7306 r7311  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-06-03 00:40:28 $
     5 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-06-03 01:02:08 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757}
    5858
    59 // Given a FITS file pointer, read the table of object data
     59// Given a FITS file pointer, write the table of object data
    6060bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file)
    6161{
     
    6464
    6565    if (view->chip == -1) {
    66         pmFPAWriteObjects (fpa, view, file);
     66        if (!pmFPAWriteObjects (fpa, view, file)) {
     67            psError(PS_ERR_IO, false, "Failed to write objects from fpa");
     68            return false;
     69        }
    6770        return true;
    6871    }
    6972
    7073    if (view->chip >= fpa->chips->n) {
     74        psError(PS_ERR_UNKNOWN, false, "Writing chip == %d (>= chips->n == %d)", view->chip, fpa->chips->n);
    7175        return false;
    7276    }
     
    7478
    7579    if (view->cell == -1) {
    76         pmChipWriteObjects (chip, view, file);
     80        if (!pmChipWriteObjects (chip, view, file)) {
     81            psError(PS_ERR_IO, false, "Failed to write objects from chip");
     82            return false;
     83        }
    7784        return true;
    7885    }
    7986
    8087    if (view->cell >= chip->cells->n) {
     88        psError(PS_ERR_UNKNOWN, false, "Writing cell == %d (>= cells->n == %d)",
     89                view->cell, chip->cells->n);
    8190        return false;
    8291    }
     
    8493
    8594    if (view->readout == -1) {
    86         pmCellWriteObjects (cell, view, file);
     95        if (!pmCellWriteObjects (cell, view, file)) {
     96            psError(PS_ERR_IO, false, "Failed to write objects from cell");
     97            return false;
     98        }
     99
    87100        return true;
    88101    }
    89102
    90103    if (view->readout >= cell->readouts->n) {
     104        psError(PS_ERR_UNKNOWN, false, "Writing readout == %d (>= readouts->n == %d)",
     105                view->readout, cell->readouts->n);
    91106        return false;
    92107    }
    93108    pmReadout *readout = cell->readouts->data[view->readout];
    94109
    95     pmReadoutWriteObjects (readout, view, file);
     110    if (!pmReadoutWriteObjects (readout, view, file)) {
     111        psError(PS_ERR_IO, false, "Failed to write objects from readout %d", view->readout);
     112        return false;
     113    }
     114
    96115    return true;
    97116}
     
    104123
    105124        pmChip *chip = fpa->chips->data[i];
    106         pmChipWriteObjects (chip, view, file);
     125        if (!pmChipWriteObjects (chip, view, file)) {
     126            psError(PS_ERR_IO, false, "Failed to write %dth chip", i);
     127            return false;
     128        }
    107129    }
    108130    return true;
     
    116138
    117139        pmCell *cell = chip->cells->data[i];
    118         pmCellWriteObjects (cell, view, file);
     140        if (!pmCellWriteObjects (cell, view, file)) {
     141            psError(PS_ERR_IO, false, "Failed to write %dth cell", i);
     142            return false;
     143        }
    119144    }
    120145    return true;
     
    128153
    129154        pmReadout *readout = cell->readouts->data[i];
    130         pmReadoutWriteObjects (readout, view, file);
     155        if (!pmReadoutWriteObjects (readout, view, file)) {
     156            psError(PS_ERR_IO, false, "Failed to write %dth readout", i);
     157            return false;
     158        }
    131159    }
    132160    return true;
     
    181209        psMetadataCopy (outhead, updates);
    182210
    183         pmSourcesWriteCMP (sources, filename, outhead);
     211        bool status = pmSourcesWriteCMP (sources, filename, outhead);
    184212        psFree (outhead);
    185213        psFree (filename);
     214
     215        if (!status) {
     216            psError(PS_ERR_IO, false, "Failed to write CMP file\n");
     217            return false;
     218        }
    186219        break;
    187220
Note: See TracChangeset for help on using the changeset viewer.