Skip to content

Commit

Permalink
If none of the requested parameters are found, throw error instead of…
Browse files Browse the repository at this point in the history
… returning empty vector
  • Loading branch information
mpartio committed Mar 4, 2024
1 parent 2f84070 commit bfe084e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion himan-plugins/source/hitool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ vector<T> hitool::VerticalExtremeValue(shared_ptr<modifier> mod, const params& w
auto _par = GetCachedParamName(par);
ret = VerticalExtremeValue<T>(mod, _par, lowerHeight, upperHeight, findValue);
UpdateCachedParamName(wantedParams, _par);
return ret;
break;
}
catch (const HPExceptionType& e)
{
Expand All @@ -336,6 +336,11 @@ vector<T> hitool::VerticalExtremeValue(shared_ptr<modifier> mod, const params& w
}
}

if (ret.empty())
{
itsLogger.Error("No data found for any of the parameters");
throw kFileDataNotFound;
}
return ret;
}

Expand Down

0 comments on commit bfe084e

Please sign in to comment.