Skip to content

Commit 1e6771c

Browse files
committed
minor CLP update
1 parent 605f60e commit 1e6771c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cryptoTools/Common/CLP.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace osuCrypto
7979
T get(const std::string& name)const
8080
{
8181
if (hasValue(name) == false)
82-
throwError(span<const std::string>(&name, 1));
82+
throw error(span<const std::string>(&name, 1));
8383

8484
std::stringstream ss;
8585
ss << *mKeyValues.at(name).begin();
@@ -107,10 +107,10 @@ namespace osuCrypto
107107
return alternative;
108108
}
109109

110-
void throwError(span<const std::string> names) const
110+
CommandLineParserError error(span<const std::string> names) const
111111
{
112112
if (names.size() == 0)
113-
throw CommandLineParserError("No tags provided.");
113+
return CommandLineParserError("No tags provided.");
114114
else
115115
{
116116
std::stringstream ss;
@@ -119,7 +119,7 @@ namespace osuCrypto
119119
ss << ", " << names[i];
120120
ss << " }";
121121

122-
throw CommandLineParserError("No values were set for tags " + ss.str());
122+
return CommandLineParserError("No values were set for tags " + ss.str());
123123
}
124124
}
125125

@@ -135,7 +135,8 @@ namespace osuCrypto
135135
if (failMessage != "")
136136
std::cout << failMessage << std::endl;
137137

138-
throwError(span<const std::string>(names.data(), names.size()));
138+
throw error(span<const std::string>(names.data(), names.size()));
139+
139140
}
140141

141142
// Return the values associated with the key.
@@ -189,7 +190,7 @@ namespace osuCrypto
189190
if (failMessage != "")
190191
std::cout << failMessage << std::endl;
191192

192-
throwError(span<const std::string>(names.data(), names.size()));
193+
throw error(span<const std::string>(names.data(), names.size()));
193194
}
194195
};
195196
}

0 commit comments

Comments
 (0)