Skip to content

Commit

Permalink
use right error callback for java/jni im read/subscribe (project-chip…
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google authored and David Lechner committed Mar 22, 2023
1 parent e1a4ce8 commit d5f78cb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d5f78cb

Please sign in to comment.