Pass the exception converter through more.

This commit is contained in:
Matthew Miller
2018-12-21 17:31:27 +10:00
committed by IronApollo
parent 9c3964d330
commit d80ac24c63
13 changed files with 67 additions and 6 deletions

View File

@ -24,6 +24,7 @@ import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.sk89q.worldedit.command.util.AsyncCommandHelper;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.util.command.parametric.ExceptionConverter;
import com.sk89q.worldedit.util.task.Supervisor;
import java.net.URL;
@ -46,10 +47,10 @@ public class ActorCallbackPaste {
* @param content The content
* @param successMessage The message, formatted with {@link String#format(String, Object...)} on success
*/
public static void pastebin(Supervisor supervisor, final Actor sender, String content, final String successMessage) {
public static void pastebin(Supervisor supervisor, final Actor sender, String content, final String successMessage, final ExceptionConverter exceptionConverter) {
ListenableFuture<URL> future = new IncendoPaste("fastasyncworldedit").paste(content);
AsyncCommandHelper.wrap(future, supervisor, sender)
AsyncCommandHelper.wrap(future, supervisor, sender, exceptionConverter)
.registerWithSupervisor("Submitting content to a pastebin service...")
.sendMessageAfterDelay("(Please wait... sending output to pastebin...)");