From fa471698a7b34731a73d30ea79370e15374e086c Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Thu, 28 Feb 2019 10:12:07 +0100 Subject: [PATCH] change exception raised if a StopRequest is catched in Host.off() --- src/bindings/java/jmsg_host.cpp | 2 +- src/bindings/java/org/simgrid/msg/Host.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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), -- 2.20.1