Do not turn state into Connecting in handlePipelineException

This commit is contained in:
Him188 2021-06-17 21:51:08 +08:00
parent faed38da9e
commit 833c9d2c97

View File

@ -69,15 +69,7 @@ internal open class NettyNetworkHandler(
}
protected open fun handlePipelineException(ctx: ChannelHandlerContext, error: Throwable) {
// context.bot.logger.error(error)
synchronized(this) {
setState { StateClosed(NettyChannelException(cause = error)) }
if (_state !is StateConnecting) {
setState { StateConnecting(ExceptionCollector(error)) }
} else {
close(error)
}
}
setState { StateClosed(NettyChannelException(cause = error)) }
}
///////////////////////////////////////////////////////////////////////////