From 5c04ad09603f40f071e4b4ad79add8d2619977bf Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Thu, 24 Aug 2017 08:57:43 +0200 Subject: jvpp: use (*env)->ExceptionClear before calling (*env)->ExceptionOccurred Change-Id: I6cca455ead986cb8a507c84957a97a40b733b16c Signed-off-by: Marek Gradzki --- src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py index 7e59cc4c785..8761eb136c2 100644 --- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py +++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py @@ -227,10 +227,13 @@ static void vl_api_${handler_name}_t_handler (vl_api_${handler_name}_t * mp) ${plugin_name}_main_t *plugin_main = &${plugin_name}_main; JNIEnv *env = jvpp_main.jenv; jthrowable exc; - $err_handler jmethodID constructor = (*env)->GetMethodID(env, ${class_ref_name}Class, "", "()V"); + + // User does not have to provide callbacks for all VPP messages. + // We are ignoring messages that are not supported by user. + (*env)->ExceptionClear(env); // just in case exception occurred in different place and was not properly cleared jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lio/fd/vpp/jvpp/${plugin_name}/dto/${dto_name};)V"); exc = (*env)->ExceptionOccurred(env); if (exc) { -- cgit 1.2.3-korg