Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix error handling.
[simgrid.git] / src / s4u / s4u_Netzone.cpp
index 57c83f3..2de7941 100644 (file)
@@ -148,7 +148,8 @@ s4u::Link* NetZone::create_link(const std::string& name, const std::vector<std::
       double speed = xbt_parse_get_bandwidth("", 0, speed_str.c_str(), nullptr, "");
       bw.push_back(speed);
     } catch (const simgrid::ParseError&) {
-      xbt_die("Link: Impossible to create_link, invalid bandwidth %s", speed_str.c_str());
+      throw std::invalid_argument(std::string("Impossible to create link: ") + name +
+                                  std::string(". Invalid bandwidth: ") + speed_str);
     }
   }
   return create_link(name, bw, policy);