Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This is our first modern exception. How stirring!
[simgrid.git] / teshsuite / s4u / actor-autorestart / actor-autorestart.cpp
index bb2d964..ecfaf8b 100644 (file)
@@ -10,8 +10,12 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example")
 static void dummy()
 {
   XBT_INFO("I start");
-  simgrid::s4u::this_actor::sleep_for(200);
-  XBT_INFO("I stop");
+  try {
+    simgrid::s4u::this_actor::sleep_for(200);
+    XBT_INFO("I stop");
+  } catch (simgrid::HostFailureException& e) {
+    XBT_DEBUG("The host has died ... as expected. This actor silently stops");
+  }
 }
 
 static void autostart()