Skip to content

Commit

Permalink
Changing catch-all to catch Throwable instead of just Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon committed Feb 7, 2023
1 parent eb71bf7 commit 9602c19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public abstract class FailureCallback {
private final void handleInternal(int errorCode, String errorMessage) {
try {
handle(new MatterError(errorCode, errorMessage));
} catch (Exception e) {
Log.e(TAG, "FailureCallback::Caught an unhandled exception from the client: " + e);
} catch (Throwable t) {
Log.e(TAG, "FailureCallback::Caught an unhandled Throwable from the client: " + t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public abstract class MatterCallbackHandler {
private final void handleInternal(int errorCode, String errorMessage) {
try {
handle(new MatterError(errorCode, errorMessage));
} catch (Exception e) {
Log.e(TAG, "MatterCallbackHandler::Caught an unhandled exception from the client: " + e);
} catch (Throwable t) {
Log.e(TAG, "MatterCallbackHandler::Caught an unhandled Throwable from the client: " + t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public abstract class SubscriptionEstablishedCallback {
private void handleInternal() {
try {
handle();
} catch (Exception e) {
} catch (Throwable t) {
Log.e(
TAG,
"SubscriptionEstablishedCallback::Caught an unhandled exception from the client: " + e);
"SubscriptionEstablishedCallback::Caught an unhandled Throwable from the client: " + t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public abstract class SuccessCallback<R> {
public void handleInternal(R response) {
try {
handle(response);
} catch (Exception e) {
Log.e(TAG, "SuccessCallback::Caught an unhandled exception from the client: " + e);
} catch (Throwable t) {
Log.e(TAG, "SuccessCallback::Caught an unhandled Throwable from the client: " + t);
}
}
}

0 comments on commit 9602c19

Please sign in to comment.