1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Use the cause of a CompletionException. Fixes GeyserMC/Floodgate#204

This commit is contained in:
Tim203
2021-09-17 13:09:16 +02:00
parent 4fd6f7eda4
commit a293ad0f6b

View File

@@ -39,6 +39,7 @@ import it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -199,6 +200,13 @@ public final class FloodgateHandshakeHandler {
return handlePart2(channel, hostname, result.left(), result.right()); return handlePart2(channel, hostname, result.left(), result.right());
} }
if (error instanceof CompletionException) {
if (error.getCause() == null) {
error.printStackTrace();
}
error = error.getCause();
}
if (error instanceof HandshakeResult) { if (error instanceof HandshakeResult) {
return (HandshakeResult) error; return (HandshakeResult) error;
} }