mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-30 09:50:12 +08:00
[core - JVM] [Network] Wrap exception from connecting to NettyChannelException
to allow selector to reconnect
This commit is contained in:
parent
1d6e6ea67d
commit
58ab562322
@ -9,7 +9,6 @@
|
||||
|
||||
package net.mamoe.mirai.internal.network.impl.netty
|
||||
|
||||
import io.ktor.utils.io.core.*
|
||||
import io.netty.bootstrap.Bootstrap
|
||||
import io.netty.buffer.ByteBuf
|
||||
import io.netty.channel.*
|
||||
@ -113,7 +112,9 @@ internal open class NettyNetworkHandler(
|
||||
}.onFailure {
|
||||
eventLoopGroup.shutdownGracefully()
|
||||
contextResult.cancel()
|
||||
}.getOrThrow()
|
||||
}.getOrElse { error ->
|
||||
throw NettyChannelException(cause = error)
|
||||
}
|
||||
|
||||
contextResult.complete(future.channel())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user