Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/monio/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@ size_t monio::Reader::findTimeStep(const FileData& fileData, const util::DateTim
return timeStep;
}
}

// Otherwise - time not found in the file. Throw a descriptive error.
closeFile();
utils::throwException("Reader::findTimeStep()> DateTime specified not located in file...");
std::stringstream msgStream;
msgStream << "Reader::findTimeStep()> DateTime specified not located in file..." << std::endl
<< " Time specified: " << dateTime.toString() << std::endl
<< " Times available:" << std::endl;

for (const auto& time : fileData.getDateTimes()) {
msgStream << " -" << time.toString() << std::endl;
}

utils::throwException(msgStream.str());
}