catch exception correctly

This commit is contained in:
creeper123123321 2021-06-03 10:48:08 -03:00
parent e3108c7420
commit 92ab4b96dc

View File

@ -96,7 +96,11 @@ class HandshakeState : MinecraftConnectionState {
if (packet.nextState == State.STATUS) { // see LoginState for LOGIN
handler.data.frontChannel.setAutoRead(false)
handler.coroutineScope.launch(Dispatchers.IO) {
connectBack(handler, packet.address, packet.port, packet.nextState)
try {
connectBack(handler, packet.address, packet.port, packet.nextState)
} catch (e: Exception) {
handler.data.frontChannel.pipeline().fireExceptionCaught(e)
}
}
}
}