Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Just keep the same exception_ptr (no copy).
[simgrid.git] / src / kernel / activity / CommImpl.cpp
index 4a1c8f6..8d6c7e3 100644 (file)
@@ -443,7 +443,7 @@ CommImpl* CommImpl::start()
       XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->get_cname(),
                 receiver->get_cname());
       state_ = SIMIX_LINK_FAILURE;
-      cleanupSurf();
+      post();
 
     } else if (src_actor_->is_suspended() || dst_actor_->is_suspended()) {
       /* If any of the process is suspended, create the synchro but stop its execution,
@@ -617,12 +617,12 @@ void CommImpl::finish()
 
         case SIMIX_SRC_TIMEOUT:
           simcall->issuer->exception_ = std::make_exception_ptr(
-              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the sender"));
+              simgrid::TimeoutException(XBT_THROW_POINT, "Communication timeouted because of the sender"));
           break;
 
         case SIMIX_DST_TIMEOUT:
           simcall->issuer->exception_ = std::make_exception_ptr(
-              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
+              simgrid::TimeoutException(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
           break;
 
         case SIMIX_SRC_HOST_FAILURE:
@@ -691,15 +691,8 @@ void CommImpl::finish()
       // In order to modify the exception we have to rethrow it:
       try {
         std::rethrow_exception(simcall->issuer->exception_);
-      } catch (simgrid::TimeoutError& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
-      } catch (simgrid::NetworkFailureException& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
-      } catch (simgrid::CancelException& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
+      } catch (simgrid::Exception& e) {
+        e.value = rank;
       }
     }