simcall_cond_wait_timeout(cond_, lock.mutex()->mutex_, timeout);
return std::cv_status::no_timeout;
}
- catch (xbt_ex& e) {
-
+ catch (const simgrid::TimeoutError& e) {
// If the exception was a timeout, we have to take the lock again:
- if (e.category == timeout_error) {
- try {
- lock.mutex()->lock();
- return std::cv_status::timeout;
- }
- catch (...) {
- std::terminate();
- }
+ try {
+ lock.mutex()->lock();
+ return std::cv_status::timeout;
+ }
+ catch (...) {
+ std::terminate();
}
-
- std::terminate();
}
catch (...) {
std::terminate();
} catch (const simgrid::TimeoutError&) {
delete payload;
XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
- } catch (xbt_ex& e) {
- if (e.category != network_error)
- xbt_die("Unexpected behavior");
- XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname());
+ } catch (const simgrid::NetworkFailureException&) {
delete payload;
+ XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname());
}
}
} catch (const simgrid::TimeoutError&) {
delete payload;
XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
- } catch (xbt_ex& e) {
+ } catch (const simgrid::NetworkFailureException&) {
delete payload;
- if (e.category != network_error)
- xbt_die("Unexpected behavior");
XBT_INFO("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
}
}
XBT_INFO("Start execution...");
simgrid::s4u::this_actor::execute(comp_size);
XBT_INFO("Execution complete.");
- } catch (xbt_ex& e) {
- if (e.category != network_error)
- xbt_die("Unexpected behavior. Category: %s", xbt_ex_catname(e.category));
+ } catch (const simgrid::NetworkFailureException&) {
XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");
}
}
} catch (const simgrid::CancelException&) {
status_ = MSG_TASK_CANCELED;
finished = true;
- } catch (xbt_ex& e) {
- if (e.category == network_error) {
- status_ = MSG_TRANSFER_FAILURE;
- finished = true;
- } else {
- throw;
- }
+ } catch (const simgrid::NetworkFailureException&) {
+ status_ = MSG_TRANSFER_FAILURE;
+ finished = true;
}
return finished;
status_ = MSG_TIMEOUT;
} catch (const simgrid::CancelException&) {
status_ = MSG_TASK_CANCELED;
- } catch (xbt_ex& e) {
- if (e.category == network_error)
- status_ = MSG_TRANSFER_FAILURE;
- else
- throw;
+ } catch (const simgrid::NetworkFailureException&) {
+ status_ = MSG_TRANSFER_FAILURE;
}
return status_;
msg_error_t status = MSG_OK;
try {
finished_index = simcall_comm_testany(s_comms.data(), s_comms.size());
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError& e) {
finished_index = e.value;
status = MSG_TIMEOUT;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException& e) {
finished_index = e.value;
status = MSG_TASK_CANCELED;
- } catch (xbt_ex& e) {
- if (e.category != network_error)
- throw;
+ } catch (const simgrid::NetworkFailureException& e) {
finished_index = e.value;
status = MSG_TRANSFER_FAILURE;
}
msg_error_t status = MSG_OK;
try {
finished_index = simcall_comm_waitany(s_comms.data(), s_comms.size(), -1);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError& e) {
finished_index = e.value;
status = MSG_TIMEOUT;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException& e) {
finished_index = e.value;
status = MSG_TASK_CANCELED;
- } catch (xbt_ex& e) {
- if (e.category == network_error) {
- finished_index = e.value;
- status = MSG_TRANSFER_FAILURE;
- } else {
- throw;
- }
+ } catch (const simgrid::NetworkFailureException& e) {
+ finished_index = e.value;
+ status = MSG_TRANSFER_FAILURE;
}
xbt_assert(finished_index != -1, "WaitAny returned -1");
ret = MSG_TIMEOUT;
} catch (const simgrid::CancelException&) {
ret = MSG_HOST_FAILURE;
- } catch (xbt_ex& e) {
- if (e.category == network_error)
- ret = MSG_TRANSFER_FAILURE;
- else
- throw;
-
+ } catch (const simgrid::NetworkFailureException&) {
+ ret = MSG_TRANSFER_FAILURE;
/* If the send failed, it is not used anymore */
set_not_used();
}
ret = MSG_TIMEOUT;
} catch (const simgrid::CancelException&) {
ret = MSG_TASK_CANCELED;
- } catch (xbt_ex& e) {
- if (e.category == network_error)
- ret = MSG_TRANSFER_FAILURE;
- else
- throw;
+ } catch (const simgrid::NetworkFailureException&) {
+ ret = MSG_TRANSFER_FAILURE;
}
if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {