From 13678822b4bec10bdf686b56fddddb9068803962 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 3 Mar 2023 12:06:16 -0800 Subject: [PATCH] use right error callback for java/jni im read/subscribe (#25453) --- 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;