pitrou commented on code in PR #10883:
URL: https://github.com/apache/arrow/pull/10883#discussion_r857664835


##########
cpp/src/jni/dataset/jni_util.cc:
##########
@@ -162,6 +165,15 @@ std::shared_ptr<ReservationListener> 
ReservationListenableMemoryPool::get_listen
 
 ReservationListenableMemoryPool::~ReservationListenableMemoryPool() {}
 
+Status CheckException(JNIEnv* env) {
+  if (env->ExceptionCheck()) {
+    env->ExceptionDescribe();
+    env->ExceptionClear();
+    return Status::Invalid("Error during calling Java code from native code");

Review Comment:
   This can be deferred to a later JIRA btw.



##########
cpp/src/jni/dataset/jni_util.cc:
##########
@@ -162,6 +165,15 @@ std::shared_ptr<ReservationListener> 
ReservationListenableMemoryPool::get_listen
 
 ReservationListenableMemoryPool::~ReservationListenableMemoryPool() {}
 
+Status CheckException(JNIEnv* env) {
+  if (env->ExceptionCheck()) {
+    env->ExceptionDescribe();
+    env->ExceptionClear();
+    return Status::Invalid("Error during calling Java code from native code");

Review Comment:
   Instead of simply dumping the exception, is it possible to add its 
description to the `Status` instance that is being returned?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to