T - The generic response type for this RestActionpublic static class AuditableRestAction.FailedRestAction<T> extends AuditableRestAction<T>
AuditableRestAction that is used to provide information that
an error has occurred while attempting to execute a request.
AuditableRestAction.EmptyRestAction<T>, AuditableRestAction.FailedRestAction<T>DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG| Constructor and Description |
|---|
FailedRestAction(java.lang.Throwable throwable) |
| Modifier and Type | Method and Description |
|---|---|
T |
complete(boolean shouldQueue)
Blocks the current Thread and awaits the completion
of an
RestAction.submit() request. |
void |
queue(java.util.function.Consumer<T> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Submits a Request for execution.
|
RequestFuture<T> |
submit(boolean shouldQueue)
Submits a Request for execution and provides a
RequestFuture
representing its completion task. |
reasoncomplete, completeAfter, getJDA, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submitAfter, submitAfterpublic void queue(java.util.function.Consumer<T> success, java.util.function.Consumer<java.lang.Throwable> failure)
RestActionThis method is asynchronous
queue in class RestAction<T>success - The success callback that will be called at a convenient time
for the API. (can be null)failure - The failure callback that will be called if the Request
encounters an exception at its execution point.public RequestFuture<T> submit(boolean shouldQueue)
RestActionRequestFuture
representing its completion task.
Note: The usage of CompletionStage.toCompletableFuture() is not supported.
submit in class RestAction<T>shouldQueue - Whether the Request should automatically handle rate limitations. (default true)RequestFuture task representing the completion promisepublic T complete(boolean shouldQueue)
RestActionRestAction.submit() request.
complete in class RestAction<T>shouldQueue - Whether this should automatically handle rate limitations (default true)