IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2010, 5:11:47 PM (16 years ago)
Author:
Paul Price
Message:

Add error checking.

File:
1 edited

Legend:

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

    r26964 r27177  
    216216
    217217    if (table->n == 0) {
    218         psFitsWriteBlank(fits, header, extname);
     218        if (!psFitsWriteBlank(fits, header, extname)) {
     219            psError(psErrorCodeLast(), false, "Unable to write empty sources file.");
     220            psFree(table);
     221            psFree(header);
     222            return false;
     223        }
    219224        psFree(table);
    220225        psFree(header);
     
    224229    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    225230    if (!psFitsWriteTable(fits, header, table, extname)) {
    226         psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
     231        psError(psErrorCodeLast(), false, "writing ext data %s\n", extname);
    227232        psFree(table);
    228233        psFree(header);
     
    486491
    487492    if (table->n == 0) {
    488         psFitsWriteBlank (fits, outhead, extname);
     493        if (!psFitsWriteBlank (fits, outhead, extname)) {
     494            psError(psErrorCodeLast(), false, "Unable to write empty sources.");
     495            psFree(outhead);
     496            psFree(table);
     497            return false;
     498        }
    489499        psFree (outhead);
    490500        psFree (table);
     
    494504    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    495505    if (!psFitsWriteTable (fits, outhead, table, extname)) {
    496         psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
     506        psError(psErrorCodeLast(), false, "writing ext data %s\n", extname);
    497507        psFree (outhead);
    498508        psFree(table);
     
    612622
    613623    if (table->n == 0) {
    614         psFitsWriteBlank (fits, outhead, extname);
     624        if (!psFitsWriteBlank (fits, outhead, extname)) {
     625            psError(psErrorCodeLast(), false, "Unable to write empty sources.");
     626            psFree(outhead);
     627            psFree(table);
     628            return false;
     629        }
    615630        psFree (outhead);
    616631        psFree (table);
     
    620635    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    621636    if (!psFitsWriteTable (fits, outhead, table, extname)) {
    622         psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
     637        psError(psErrorCodeLast(), false, "writing ext data %s\n", extname);
    623638        psFree (outhead);
    624639        psFree(table);
Note: See TracChangeset for help on using the changeset viewer.