From: Martin Quinson Date: Sat, 25 Aug 2018 20:02:07 +0000 (+0200) Subject: convert all xbt_ex(timeout_error) throwing locations to simgrid::TimeoutError X-Git-Tag: v3_21~167 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5d3e71cc5617674a92703e4b45d9b9951aed7d0a convert all xbt_ex(timeout_error) throwing locations to simgrid::TimeoutError --- diff --git a/include/simgrid/Exception.hpp b/include/simgrid/Exception.hpp index e09cde016d..9d398b4ac5 100644 --- a/include/simgrid/Exception.hpp +++ b/include/simgrid/Exception.hpp @@ -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 */ diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 779e2dcc6b..745a67db77 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -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: diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index ea0d502246..6599c019e5 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -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: