From bfe084e9706154020475e6ea650406fc05407b5b Mon Sep 17 00:00:00 2001 From: Mikko Partio Date: Mon, 4 Mar 2024 09:52:35 +0200 Subject: [PATCH] If none of the requested parameters are found, throw error instead of returning empty vector --- himan-plugins/source/hitool.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/himan-plugins/source/hitool.cpp b/himan-plugins/source/hitool.cpp index 439be578..dc7efd17 100644 --- a/himan-plugins/source/hitool.cpp +++ b/himan-plugins/source/hitool.cpp @@ -321,7 +321,7 @@ vector hitool::VerticalExtremeValue(shared_ptr mod, const params& w auto _par = GetCachedParamName(par); ret = VerticalExtremeValue(mod, _par, lowerHeight, upperHeight, findValue); UpdateCachedParamName(wantedParams, _par); - return ret; + break; } catch (const HPExceptionType& e) { @@ -336,6 +336,11 @@ vector hitool::VerticalExtremeValue(shared_ptr mod, const params& w } } + if (ret.empty()) + { + itsLogger.Error("No data found for any of the parameters"); + throw kFileDataNotFound; + } return ret; }