Skip to content

Commit

Permalink
refactor loggers, archiving thread incase of failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitsmt211 committed Dec 12, 2023
1 parent f82821a commit eb166a8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ private void handleArchiveFlow(ThreadChannel threadChannel, MessageEmbed embed)

Consumer<Throwable> handleFailure = error -> {
if (error instanceof ErrorResponseException) {
logger.warn("Unknown error occurred during help thread auto archive routine",
logger.warn(
"Unknown error occurred during help thread auto archive routine, archiving thread",
error);

threadChannel.getManager().setArchived(true).queue();
}
};

Expand All @@ -148,7 +151,8 @@ private void handleArchiveFlow(ThreadChannel threadChannel, MessageEmbed embed)
if (member.isSuccess()) {
return sendEmbedWithMention.apply(member);
}
logger.debug("Member already left server, archiving thread without mention");

logger.debug("Unable to mention user", member.getFailure());
return sendEmbedWithoutMention.apply(member);
})
.flatMap(any -> threadChannel.getManager().setArchived(true))
Expand Down

0 comments on commit eb166a8

Please sign in to comment.