|
|
@@ -55,10 +55,14 @@ T convert(std::string const & name, std::string const & data) {
|
|
|
template <typename T>
|
|
|
T convert(std::string const & name, std::vector<std::string> const & data) {
|
|
|
conversion_helper<T> helper;
|
|
|
- if constexpr (traits::is_repeatable_v<decltype(helper)>) {
|
|
|
- return helper(data);
|
|
|
- } else if (data.size() == 1) {
|
|
|
- return helper(data.front());
|
|
|
+ try {
|
|
|
+ if constexpr (traits::is_repeatable_v<decltype(helper)>) {
|
|
|
+ return helper(data);
|
|
|
+ } else if (data.size() == 1) {
|
|
|
+ return helper(data.front());
|
|
|
+ }
|
|
|
+ } catch (std::exception const & ex) {
|
|
|
+ throw ArgumentStructureError(ex.what(), name);
|
|
|
}
|
|
|
throw ArgumentStructureError("Repeated option not allowed", name);
|
|
|
}
|