Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert some catch locations to simgrid::HostFailureException
[simgrid.git] / teshsuite / msg / host_on_off_processes / host_on_off_processes.cpp
index 278c103..122a39a 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/exception.hpp"
+#include "simgrid/Exception.hpp"
 #include "simgrid/msg.h"
 
 #include <stdio.h> /* sscanf */
@@ -58,13 +58,8 @@ static int commTX(int /*argc*/, char** /*argv*/)
   // We should wait a bit (if not the process will end before the communication, hence an exception on the other side).
   try {
     MSG_process_sleep(30);
-  } catch (xbt_ex& e) {
-    if (e.category == host_error) {
-      XBT_INFO("The host has died ... as expected.");
-    } else {
-      XBT_ERROR("An unexpected exception has been raised.");
-      throw;
-    }
+  } catch (simgrid::HostFailureException& e) {
+    XBT_INFO("The host has died ... as expected.");
   }
   XBT_INFO("  TX done");
   return 0;