diff --git a/common/common.h b/common/common.h index 9194d3dcb..527f4be7d 100644 --- a/common/common.h +++ b/common/common.h @@ -809,7 +809,9 @@ static std::vector string_split(const std::string & str, char delim) { while (std::getline(str_stream, token, delim)) { T value; std::istringstream token_stream(token); - token_stream >> value; + if (!(token_stream >> value)) { + throw std::invalid_argument("invalid value: \"" + token + "\""); + } values.push_back(value); } return values;