Add exceptions for missing input files

This commit is contained in:
Jean-Sébastien Caux
2026-10-23 13:23:31 +02:00
parent e0cf0c388c
commit 64bfe71805
5 changed files with 33 additions and 0 deletions
+9
View File
@@ -91,18 +91,27 @@ void Orchestrator::set_up()
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);