Changeset 17743 for trunk/Mars/mcore


Ignore:
Timestamp:
04/30/14 16:04:13 (11 years ago)
Author:
tbretz
Message:
Some fixes to the no-exception part.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zfits.h

    r17685 r17743  
    409409            // uncompress  the buffer
    410410            const uint32_t thisRoundNumRows = (GetNumRows()<fCurrentRow + fNumRowsPerTile) ? GetNumRows()%fNumRowsPerTile : fNumRowsPerTile;
    411             UncompressBuffer(offsets, thisRoundNumRows, offset+sizeof(FITS::TileHeader));
     411            if (!UncompressBuffer(offsets, thisRoundNumRows, offset+sizeof(FITS::TileHeader)))
     412                return false;
    412413
    413414            // pointer to column (source buffer)
     
    444445                default:
    445446                    clear(rdstate()|std::ios::badbit);
     447
     448                    std::ostringstream str;
     449                    str << "Unkown column ordering scheme found (i=" << i << ", " << fColumnOrdering[i] << ")";
    446450#ifdef __EXCEPTIONS
    447                     throw std::runtime_error("Unkown column ordering scheme found");
     451                    throw std::runtime_error(str);
    448452#else
    449                     gLog << ___err___ << "ERROR - unkown column ordering scheme" << std::endl;
     453                    gLog << ___err___ << "ERROR - " << str.str() << std::endl;
    450454                    return false;
    451455#endif
    452                     break;
    453456                };
    454457            }
     
    508511
    509512    // Data has been read from disk. Uncompress it !
    510     void UncompressBuffer(const std::vector<size_t> &offsets,
     513    bool UncompressBuffer(const std::vector<size_t> &offsets,
    511514                          const uint32_t &thisRoundNumRows,
    512515                          const uint32_t offset)
     
    555558
    556559                    std::ostringstream str;
    557                     str << "Unkown processing applied to data. Col " << i << " proc " << j << " out of " << (int)head->numProcs;
     560                    str << "Unknown processing applied to data (col=" << i << ", proc=" << j << "/" << (int)head->numProcs;
    558561#ifdef __EXCEPTIONS
    559562                    throw std::runtime_error(str.str());
    560563#else
    561                     gLog << ___err___ << "ERROR - Unknown processing applied to data. Aborting" << std::endl;
    562                     return;
     564                    gLog << ___err___ << "ERROR - " << str.str() << std::endl;
     565                    return false;
    563566#endif
    564567                }
     
    568571            }
    569572        }
     573
     574        return true;
    570575    }
    571576
Note: See TracChangeset for help on using the changeset viewer.