Changeset 27177 for trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
- Timestamp:
- Mar 3, 2010, 5:11:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
r26964 r27177 216 216 217 217 if (table->n == 0) { 218 psFitsWriteBlank(fits, header, extname); 218 if (!psFitsWriteBlank(fits, header, extname)) { 219 psError(psErrorCodeLast(), false, "Unable to write blank sources file."); 220 psFree(table); 221 psFree(header); 222 return false; 223 } 219 224 psFree(table); 220 225 psFree(header); … … 224 229 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 225 230 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); 227 232 psFree(table); 228 233 psFree(header); … … 264 269 for (int i = 0; i < numSources; i++) { 265 270 psMetadata *row = psFitsReadTableRow(fits, i); // Table row 271 if (!row) { 272 psError(psErrorCodeLast(), false, "Unable to read row %d of sources", i); 273 psFree(sources); 274 return NULL; 275 } 266 276 267 277 pmSource *source = pmSourceAlloc (); … … 487 497 488 498 if (table->n == 0) { 489 psFitsWriteBlank (fits, outhead, extname); 499 if (!psFitsWriteBlank (fits, outhead, extname)) { 500 psError(psErrorCodeLast(), false, "Unable to write empty sources file."); 501 psFree(outhead); 502 psFree(table); 503 return false; 504 } 490 505 psFree (outhead); 491 506 psFree (table); … … 495 510 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 496 511 if (!psFitsWriteTable (fits, outhead, table, extname)) { 497 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);512 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 498 513 psFree (outhead); 499 514 psFree(table); … … 613 628 614 629 if (table->n == 0) { 615 psFitsWriteBlank (fits, outhead, extname); 630 if (!psFitsWriteBlank (fits, outhead, extname)) { 631 psError(psErrorCodeLast(), false, "Unable to write empty sources file."); 632 psFree(outhead); 633 psFree(table); 634 return false; 635 } 616 636 psFree (outhead); 617 637 psFree (table); … … 621 641 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 622 642 if (!psFitsWriteTable (fits, outhead, table, extname)) { 623 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);643 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 624 644 psFree (outhead); 625 645 psFree(table);
Note:
See TracChangeset
for help on using the changeset viewer.
