mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-26 07:20:09 +08:00
Optimize HeartbeatFailedException.toString
: show information of its cause
This commit is contained in:
parent
ab7c49a0d5
commit
45ba713f73
mirai-core/src/commonMain/kotlin/network/impl/netty
@ -12,6 +12,9 @@ package net.mamoe.mirai.internal.network.impl.netty
|
||||
import net.mamoe.mirai.internal.network.handler.selector.NetworkException
|
||||
|
||||
internal class HeartbeatFailedException(
|
||||
override val message: String?,
|
||||
private val name: String, // kind of HB
|
||||
override val cause: Throwable? = null
|
||||
) : NetworkException(true)
|
||||
) : NetworkException(true) {
|
||||
override val message: String = "Exception in $name job"
|
||||
override fun toString(): String = "HeartbeatFailedException: $name, cause=$cause"
|
||||
}
|
@ -355,7 +355,7 @@ internal open class NettyNetworkHandler(
|
||||
|
||||
private val heartbeatJobs =
|
||||
context[HeartbeatScheduler].launchJobsIn(this@NettyNetworkHandler, this) { name, e ->
|
||||
setState { StateClosed(HeartbeatFailedException("Exception in $name job", e)) }
|
||||
setState { StateClosed(HeartbeatFailedException(name, e)) }
|
||||
}
|
||||
|
||||
// we can also move them as observers if needed.
|
||||
|
Loading…
Reference in New Issue
Block a user