Skip to content
Snippets Groups Projects
Commit d9eb8ebb authored by Franck Dary's avatar Franck Dary
Browse files

Improved error message for failed stof in NumericColumnModule

parent e9e816f5
Branches
Tags
No related merge requests found
......@@ -80,8 +80,9 @@ void NumericColumnModuleImpl::addToContext(std::vector<std::vector<long>> & cont
if (index >= 0)
{
auto value = config.getAsFeature(column, index).get();
try {res = std::stof(value);}
catch (std::exception &) {res = defaultValue;}
try {res = value == "_" ? defaultValue : std::stof(value);}
catch (std::exception & e)
{util::myThrow(fmt::format("{} for '{}'", e.what(), value));}
}
contextElement.emplace_back(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment