use of net.dv8tion.jda.api.events.ExceptionEvent in project JDA by DV8FromTheWorld.
the class Request method onFailure.
public void onFailure(Throwable failException) {
if (done)
return;
done = true;
api.getCallbackPool().execute(() -> {
try (ThreadLocalReason.Closable __ = ThreadLocalReason.closable(localReason);
CallbackContext ___ = CallbackContext.getInstance()) {
onFailure.accept(failException);
if (failException instanceof Error)
api.handleEvent(new ExceptionEvent(api, failException, false));
} catch (Throwable t) {
RestActionImpl.LOG.error("Encountered error while processing failure consumer", t);
if (t instanceof Error) {
api.handleEvent(new ExceptionEvent(api, t, true));
throw (Error) t;
}
}
});
}
Aggregations