From eb88483b45024994cd5f4b9d5e15124b4712dadc Mon Sep 17 00:00:00 2001 From: Yunhan Wang Date: Thu, 2 Mar 2023 22:23:06 -0800 Subject: [PATCH] use right error callback for java/jni im read/subscribe --- src/controller/java/CHIPDeviceController-JNI.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 966b84533ecf46..5da3d86ff4be04 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -1295,8 +1295,7 @@ JNI_METHOD(void, subscribe) err = readClient->SendRequest(params); if (err != CHIP_NO_ERROR) { - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback->mReportCallbackRef, ErrorStr(err), - err); + callback->OnError(err); delete readClient; delete callback; return; @@ -1347,8 +1346,7 @@ JNI_METHOD(void, read) err = readClient->SendRequest(params); if (err != CHIP_NO_ERROR) { - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback->mReportCallbackRef, ErrorStr(err), - err); + callback->OnError(err); delete readClient; delete callback; return;