mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
Validate step size field better
This commit is contained in:
@@ -66,6 +66,10 @@ HorizonsFile::HorizonsResult HorizonsFile::isValidAnswer(const json& answer) {
|
||||
if (errorMessage.find("Projected output length") != std::string::npos) {
|
||||
return HorizonsFile::HorizonsResult::ErrorSize;
|
||||
}
|
||||
// STEP_SIZE too big, exceeds available span.
|
||||
else if (errorMessage.find("STEP_SIZE too big") != std::string::npos) {
|
||||
return HorizonsFile::HorizonsResult::ErrorSpan;
|
||||
}
|
||||
// No ephemeris for target "X" after A.D. Y UT
|
||||
else if (errorMessage.find("No ephemeris for target") != std::string::npos) {
|
||||
return HorizonsFile::HorizonsResult::ErrorTimeRange;
|
||||
@@ -125,6 +129,12 @@ HorizonsFile::HorizonsResult HorizonsFile::isValidHorizonsFile() const {
|
||||
return HorizonsFile::HorizonsResult::ErrorSize;
|
||||
}
|
||||
|
||||
// Selected time range too big for avalable time span?
|
||||
if (line.find("STEP_SIZE too big") != std::string::npos) {
|
||||
fileStream.close();
|
||||
return HorizonsFile::HorizonsResult::ErrorSpan;
|
||||
}
|
||||
|
||||
// Outside valid time range?
|
||||
if (line.find("No ephemeris for target") != std::string::npos) {
|
||||
// Available time range is located several lines before this in the file
|
||||
|
||||
Reference in New Issue
Block a user