Skip to content

Commit

Permalink
use helper function strToDouble for locale independent parsing of colors
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschmeisser authored and scpeters committed Nov 14, 2018
1 parent e7e0972 commit f97cbce
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions urdf_model/include/urdf_model/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ class Color
{
try
{
rgba.push_back(std::stof(pieces[i]));
rgba.push_back(strToDouble(pieces[i].c_str()));
}
catch (std::invalid_argument &/*e*/) {
return false;
}
catch (std::out_of_range &/*e*/) {
return false;
catch (std::runtime_error &/*e*/) {
throw ParseError("Unable to parse component [" + pieces[i] + "] to a double (while parsing a color value)");
}
}
}
Expand Down

0 comments on commit f97cbce

Please sign in to comment.