Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 00f8878

Browse files
author
Eric Dahlvang
committed
address some Tracy's feedback
1 parent 178d266 commit 00f8878

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

libraries/bot-builder/src/main/java/com/microsoft/bot/builder/teams/TeamsActivityHandler.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,17 @@ protected CompletableFuture<Void> onTeamsMembersAddedDispatch(
456456
try {
457457
teamsChannelAccount = TeamsInfo.getMember(turnContext, memberAdded.getId()).join();
458458
} catch (CompletionException ex) {
459-
try {
460-
throw ex.getCause();
461-
} catch (ErrorResponseException erx) {
462-
ErrorResponse response = erx.body();
459+
Throwable causeException = ex.getCause();
460+
if (causeException instanceof ErrorResponseException) {
461+
ErrorResponse response = ((ErrorResponseException) causeException).body();
463462
if (response != null) {
464463
Error error = response.getError();
465464
if (error != null && !error.getCode().equals("ConversationNotFound")) {
466-
throw erx;
465+
throw ex;
467466
}
468467
}
469-
} catch (Throwable impossible) {
470-
throw new AssertionError(impossible);
468+
} else {
469+
throw ex;
471470
}
472471
}
473472

0 commit comments

Comments
 (0)