From 17e97e7d0a06d3340355bc5045bf65e4bb0c31c5 Mon Sep 17 00:00:00 2001 From: Alan Grossfield Date: Tue, 2 Apr 2024 20:50:15 -0400 Subject: [PATCH] better error messages --- src/Trajectory.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trajectory.hpp b/src/Trajectory.hpp index abbc86ad..1a031966 100644 --- a/src/Trajectory.hpp +++ b/src/Trajectory.hpp @@ -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));