Add exceptions for missing input files
This commit is contained in:
@@ -104,18 +104,27 @@ int main(int argc, char* argv[])
|
||||
states_filename << filename_base.str() << ".states";
|
||||
std::ifstream states_file;
|
||||
states_file.open(states_filename.str());
|
||||
if (states_file.fail()) {
|
||||
throw AbacusException("Cound not open the states file " + states_filename.str());
|
||||
}
|
||||
states_file >> std::setprecision(std::numeric_limits<Real>::digits10 + 1);
|
||||
|
||||
std::stringstream amplitudes_filename;
|
||||
amplitudes_filename << filename_base.str() << "_" << protocol_ << ".amplitudes";
|
||||
std::ifstream amplitudes_file;
|
||||
amplitudes_file.open(amplitudes_filename.str());
|
||||
if (amplitudes_file.fail()) {
|
||||
throw AbacusException("Cound not open the amplitudes file " + amplitudes_filename.str());
|
||||
}
|
||||
amplitudes_file >> std::setprecision(std::numeric_limits<Real>::digits10 + 1);
|
||||
|
||||
std::stringstream rho_ME_filename;
|
||||
rho_ME_filename << filename_base.str() << ".rho";
|
||||
std::ifstream rho_ME_file;
|
||||
rho_ME_file.open(rho_ME_filename.str());
|
||||
if (rho_ME_file.fail()) {
|
||||
throw AbacusException("Cound not open the rho file " + rho_ME_filename.str());
|
||||
}
|
||||
rho_ME_file >> std::setprecision(std::numeric_limits<Real>::digits10 + 1);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user