Ignore:
Timestamp:
02/18/15 12:07:29 (10 years ago)
Author:
tbretz
Message:
Accounted for the change in exception handling.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mdrs/MDrsCalibrationTime.cc

    r18123 r18144  
    5151bool MDrsCalibrationTime::ReadFits(const string &fname)
    5252{
    53     const std::string msg = DrsCalibrateTime::ReadFitsImp(fname);
     53    string msg;
     54    try
     55    {
     56        msg = DrsCalibrateTime::ReadFitsImp(fname);
     57    }
     58    catch (const exception &e)
     59    {
     60        msg = e.what();
     61    }
     62
    5463    if (msg.empty())
    5564    {
    56         *fLog << inf << "Wrote DRS calibration file " << fname << endl;
    57         return kTRUE;
     65        *fLog << inf << "Read DRS calibration file " << fname << endl;
     66        return true;
    5867    }
    5968
    60     *fLog << err << "Error writing to " << fname << ": " << msg << endl;
    61     return kFALSE;
     69    *fLog << err << "Error reading from " << fname << ": " << msg << endl;
     70    return false;
    6271}
    6372
     
    6877    {
    6978        *fLog << err << "File '" << fname << "' already exists." << endl;
    70         return kFALSE;
     79        return false;
    7180    }
    7281
    73     const std::string msg = DrsCalibrateTime::WriteFitsImp(fname);
     82    string msg;
     83    try
     84    {
     85        msg = DrsCalibrateTime::WriteFitsImp(fname);
     86    }
     87    catch (const exception &e)
     88    {
     89        msg = e.what();
     90    }
     91
    7492    if (msg.empty())
    7593    {
    7694        *fLog << inf << "Wrote DRS calibration file " << fname << endl;
    77         return kTRUE;
     95        return true;
    7896    }
    7997
    8098    *fLog << err << "Error writing to " << fname << ": " << msg << endl;
    81     return kFALSE;
     99    return false;
    82100}
Note: See TracChangeset for help on using the changeset viewer.