@@ -79,7 +79,7 @@ namespace osuCrypto
79
79
T get (const std::string& name)const
80
80
{
81
81
if (hasValue (name) == false )
82
- throwError (span<const std::string>(&name, 1 ));
82
+ throw error (span<const std::string>(&name, 1 ));
83
83
84
84
std::stringstream ss;
85
85
ss << *mKeyValues .at (name).begin ();
@@ -107,10 +107,10 @@ namespace osuCrypto
107
107
return alternative;
108
108
}
109
109
110
- void throwError (span<const std::string> names) const
110
+ CommandLineParserError error (span<const std::string> names) const
111
111
{
112
112
if (names.size () == 0 )
113
- throw CommandLineParserError (" No tags provided." );
113
+ return CommandLineParserError (" No tags provided." );
114
114
else
115
115
{
116
116
std::stringstream ss;
@@ -119,7 +119,7 @@ namespace osuCrypto
119
119
ss << " , " << names[i];
120
120
ss << " }" ;
121
121
122
- throw CommandLineParserError (" No values were set for tags " + ss.str ());
122
+ return CommandLineParserError (" No values were set for tags " + ss.str ());
123
123
}
124
124
}
125
125
@@ -135,7 +135,8 @@ namespace osuCrypto
135
135
if (failMessage != " " )
136
136
std::cout << failMessage << std::endl;
137
137
138
- throwError (span<const std::string>(names.data (), names.size ()));
138
+ throw error (span<const std::string>(names.data (), names.size ()));
139
+
139
140
}
140
141
141
142
// Return the values associated with the key.
@@ -189,7 +190,7 @@ namespace osuCrypto
189
190
if (failMessage != " " )
190
191
std::cout << failMessage << std::endl;
191
192
192
- throwError (span<const std::string>(names.data (), names.size ()));
193
+ throw error (span<const std::string>(names.data (), names.size ()));
193
194
}
194
195
};
195
196
}
0 commit comments