Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a more specific exception.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 6 Nov 2017 20:23:35 +0000 (21:23 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 8 Nov 2017 16:36:22 +0000 (17:36 +0100)
src/mc/mc_record.cpp

index 5018b25..4af7633 100644 (file)
@@ -77,7 +77,7 @@ RecordTrace parseRecordTrace(const char* data)
   RecordTrace res;
   XBT_INFO("path=%s", data);
   if (data == nullptr || data[0] == '\0')
   RecordTrace res;
   XBT_INFO("path=%s", data);
   if (data == nullptr || data[0] == '\0')
-    throw std::runtime_error("Could not parse record path");
+    throw std::invalid_argument("Could not parse record path");
 
   const char* current = data;
   while (*current) {
 
   const char* current = data;
   while (*current) {
@@ -85,7 +85,7 @@ RecordTrace parseRecordTrace(const char* data)
     simgrid::mc::Transition item;
     int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
     if(count != 2 && count != 1)
     simgrid::mc::Transition item;
     int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
     if(count != 2 && count != 1)
-      throw std::runtime_error("Could not parse record path");
+      throw std::invalid_argument("Could not parse record path");
     res.push_back(item);
 
     // Find next chunk:
     res.push_back(item);
 
     // Find next chunk: