Skip to content

Commit

Permalink
handle jda exception that is inside ExecutionException
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed May 6, 2024
1 parent 6cfce35 commit 8f258b1
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,11 @@ private Message updateMessage() throws IllegalStateException {
if (currentMessage != null) {
try {
return currentMessage.editMessage(full).submit().get();
} catch (ErrorResponseException e) {
if (e.getErrorResponse() == ErrorResponse.UNKNOWN_MESSAGE) {
currentMessage = null;
} else {
throw e;
}
} catch (ExecutionException e) {
currentMessage = null;
throw new RuntimeException(e);
if (!(e.getCause() instanceof ErrorResponseException)) {
throw new RuntimeException(e);
}
} catch (InterruptedException e) {
JDA.Status status = channel.getJDA().getStatus();
if (status == JDA.Status.SHUTTING_DOWN || status == JDA.Status.SHUTDOWN) {
Expand Down

0 comments on commit 8f258b1

Please sign in to comment.