Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rethrow errors
Browse files Browse the repository at this point in the history
freya022 committed Jul 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent da699fe commit ac2ca3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/net/dv8tion/jda/api/utils/Once.java
Original file line number Diff line number Diff line change
@@ -91,6 +91,8 @@ private ScheduledFuture<?> scheduleTimeout(@Nullable Duration timeout, @Nullable
catch (Throwable e)
{
LOG.error("An error occurred while running the timeout callback", e);
if (e instanceof Error)
throw (Error) e;
}
}
}, timeout.toMillis(), TimeUnit.MILLISECONDS);
@@ -117,6 +119,8 @@ public void onEvent(@Nonnull GenericEvent event)
{
if (future.completeExceptionally(e))
event.getJDA().removeEventListener(this);
if (e instanceof Error)
throw (Error) e;
}
}

0 comments on commit ac2ca3d

Please sign in to comment.