From: Frederic Suter Date: Thu, 28 Feb 2019 09:12:07 +0000 (+0100) Subject: change exception raised if a StopRequest is catched in Host.off() X-Git-Tag: v3_22~214 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fa471698a7b34731a73d30ea79370e15374e086c?hp=dbd1fc0b7925a876ec89c0053b37c765b4969434 change exception raised if a StopRequest is catched in Host.off() --- diff --git a/src/bindings/java/jmsg_host.cpp b/src/bindings/java/jmsg_host.cpp index 299d8db5a8..e25ad9d881 100644 --- a/src/bindings/java/jmsg_host.cpp +++ b/src/bindings/java/jmsg_host.cpp @@ -143,7 +143,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost) JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost) { msg_host_t host = jhost_get_native(env, jhost); if (not simgrid::kernel::context::StopRequest::try_n_catch([host]() { MSG_host_off(host); })) - jxbt_throw_host_failure(env, ""); + jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed"); } JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount(JNIEnv * env, jclass cls) { diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java index 622218694e..6042b0430d 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -111,7 +111,7 @@ public class Host { /** Starts the host if it is off */ public native void on(); /** Stops the host if it is on */ - public native void off() throws HostFailureException; + public native void off() throws ProcessKilledError; /** * This method returns the speed of the processor of a host (in flops),