Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
agrossfield committed Apr 3, 2024
1 parent 3286fc6 commit 17e97e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Trajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ namespace loos {
try {
fileSize = boost::filesystem::file_size(fname);
} catch (boost::filesystem::filesystem_error& e) {
throw(FileOpenError(fname));
throw(FileOpenError(fname, std::string("Error computing file size: ") + e.what()));
}
if (fileSize == 0) {
throw(FileReadError(fname));
throw(FileReadError(fname, std::string("File is empty")));
}

ifs = pStream(new std::fstream(fname.c_str(), std::ios_base::in | std::ios_base::binary));
Expand Down

0 comments on commit 17e97e7

Please sign in to comment.