- switch (synchro->state) {
-
- case SIMIX_DONE:
- XBT_DEBUG("Communication %p complete!", synchro);
- SIMIX_comm_copy_data(synchro);
- break;
-
- case SIMIX_SRC_TIMEOUT:
- SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Communication timeouted because of sender");
- break;
-
- case SIMIX_DST_TIMEOUT:
- SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Communication timeouted because of receiver");
- break;
-
- case SIMIX_SRC_HOST_FAILURE:
- if (simcall->issuer == comm->src_proc)
- simcall->issuer->context->iwannadie = 1;
- // SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
- else
- SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
- break;
-
- case SIMIX_DST_HOST_FAILURE:
- if (simcall->issuer == comm->dst_proc)
- simcall->issuer->context->iwannadie = 1;
- // SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
- else
- SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
- break;
-
- case SIMIX_LINK_FAILURE:
-
- XBT_DEBUG(
- "Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) detached:%d",
- synchro, comm->src_proc ? comm->src_proc->host->cname() : nullptr,
- comm->dst_proc ? comm->dst_proc->host->cname() : nullptr, simcall->issuer->cname(), simcall->issuer,
- comm->detached);
- if (comm->src_proc == simcall->issuer) {
- XBT_DEBUG("I'm source");
- } else if (comm->dst_proc == simcall->issuer) {
- XBT_DEBUG("I'm dest");
- } else {
- XBT_DEBUG("I'm neither source nor dest");
- }
- SMX_EXCEPTION(simcall->issuer, network_error, 0, "Link failure");
- break;
+ switch (comm->state_) {
+
+ case SIMIX_DONE:
+ XBT_DEBUG("Communication %p complete!", synchro.get());
+ SIMIX_comm_copy_data(synchro);
+ break;
+
+ case SIMIX_SRC_TIMEOUT:
+ simcall->issuer->exception = std::make_exception_ptr(
+ simgrid::TimeoutError(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"));
+ break;
+
+ case SIMIX_SRC_HOST_FAILURE:
+ if (simcall->issuer == comm->src_proc)
+ simcall->issuer->context_->iwannadie = 1;
+ else
+ simcall->issuer->exception =
+ std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
+ break;