Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert all xbt_ex(timeout_error) throwing locations to simgrid::TimeoutError
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Aug 2018 20:02:07 +0000 (22:02 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Aug 2018 20:02:07 +0000 (22:02 +0200)
include/simgrid/Exception.hpp
src/simix/smx_host.cpp
src/simix/smx_network.cpp

index e09cde0..9d398b4 100644 (file)
@@ -110,6 +110,11 @@ namespace simgrid {
 
 /** Exception raised when a timeout elapsed */
 class TimeoutError : public xbt_ex {
+public:
+  TimeoutError(simgrid::xbt::ThrowPoint throwpoint, std::string message) : xbt_ex(throwpoint, message)
+  {
+    category = timeout_error;
+  }
 };
 
 /** Exception raised when an host fails */
index 779e2dc..745a67d 100644 (file)
@@ -140,7 +140,7 @@ void SIMIX_execution_finish(smx_activity_t synchro)
 
       case SIMIX_TIMEOUT:
         XBT_DEBUG("SIMIX_execution_finished: execution timeouted");
-        SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Timeouted");
+        simcall->issuer->exception = std::make_exception_ptr(simgrid::TimeoutError(XBT_THROW_POINT, "Timeouted"));
         break;
 
       default:
index ea0d502..6599c01 100644 (file)
@@ -532,11 +532,13 @@ void SIMIX_comm_finish(smx_activity_t synchro)
           break;
 
         case SIMIX_SRC_TIMEOUT:
-          SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Communication timeouted because of sender");
+          simcall->issuer->exception = std::make_exception_ptr(
+              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the sender"));
           break;
 
         case SIMIX_DST_TIMEOUT:
-          SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Communication timeouted because of receiver");
+          simcall->issuer->exception = std::make_exception_ptr(
+              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
           break;
 
         case SIMIX_SRC_HOST_FAILURE: