Skip to content
Snippets Groups Projects
Commit 48a4196a authored by Elisabetta Pianori's avatar Elisabetta Pianori
Browse files

Merge branch 'dantrim_filecalibration_filecheck' into 'devel'

Check that provided file exists in FileCalibration constructor

See merge request berkeleylab/labRemote!190
parents 9b4b505a eed7e123
Branches
No related tags found
No related merge requests found
......@@ -2,10 +2,15 @@
#include <cmath>
#include <fstream>
#include <stdexcept>
FileCalibration::FileCalibration(const std::string& path)
{
std::ifstream fh(path);
if(!fh.good()) {
throw std::runtime_error("Provided file (" + path + ") is bad, it could not be found or opened");
}
// Read header
std::string dummy;
std::getline(fh, dummy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment