From 3de32218ed55940c80e19f0e2e7a443fbcb3f39c Mon Sep 17 00:00:00 2001 From: AyanRoy16 Date: Mon, 2 Oct 2023 15:11:41 -0400 Subject: [PATCH] Fixing the code for handling failed bool test cases --- src/libraries/JANA/Services/JParameterManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/JANA/Services/JParameterManager.h b/src/libraries/JANA/Services/JParameterManager.h index 8b6b08eaa..6fea718f5 100644 --- a/src/libraries/JANA/Services/JParameterManager.h +++ b/src/libraries/JANA/Services/JParameterManager.h @@ -325,8 +325,8 @@ inline void JParameterManager::Parse(const std::string& value, std::string& out) template <> inline void JParameterManager::Parse(const std::string& value, bool& val) { if (value == "0" || value =="false" || value == "off") val = false; - if (value == "1" || value == "true" || value == "on") val = true; - throw JException("'%s' not parseable as bool", value.c_str()); + else if (value == "1" || value == "true" || value == "on") val = true; + else throw JException("'%s' not parseable as bool", value.c_str()); } // @brief Template to parse a string and return in an array