- this->numBladesPerChassis_ = xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
- this->numLinksGreen_ = xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links for the green level: %s");
+ try {
+ this->numBladesPerChassis_ = std::stoi(tmp[0]);
+ } catch (std::invalid_argument& ia) {
+ throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
+ }
+
+ try {
+ this->numLinksGreen_ = std::stoi(tmp[1]);
+ } catch (std::invalid_argument& ia) {
+ throw std::invalid_argument(std::string("Invalid number of links for the green level:") + tmp[1]);
+ }