Skip to content

Commit

Permalink
Fix unknown message stacktrace loop in console
Browse files Browse the repository at this point in the history
Closes #21
Fixes #18
  • Loading branch information
Vankka committed May 11, 2024
1 parent 252e766 commit 84b88d6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ private Message updateMessage() throws IllegalStateException {
if (currentMessage != null) {
try {
return currentMessage.editMessage(full).submit().get();
} catch (ErrorResponseException e) {
if (e.getErrorResponse() == ErrorResponse.UNKNOWN_MESSAGE) {
} catch (ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof ErrorResponseException
&& ((ErrorResponseException) cause).getErrorResponse() == ErrorResponse.UNKNOWN_MESSAGE) {
currentMessage = null;
} else {
throw e;
throw new RuntimeException(cause);
}
} catch (ExecutionException e) {
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 84b88d6

Please sign in to comment.