Better error details during connect phase

This commit is contained in:
Robinson 2023-09-08 14:18:35 +02:00
parent c69512eda4
commit 3d8c5275ac
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 10 additions and 5 deletions

View File

@ -679,7 +679,14 @@ open class Client<CONNECTION : Connection>(
break
}
listenerManager.notifyError(ClientException("[${handshake.connectKey}] : Un-recoverable error during handshake with $handshakeConnection. Aborting.", e))
val type = if (isIPC) {
"IPC"
} else {
"$remoteAddressPrettyString:$port1:$port2"
}
listenerManager.notifyError(ClientException("[${handshake.connectKey}] : Un-recoverable error during handshake with $type. Aborting.", e))
resetOnError()
throw e
}
@ -689,16 +696,14 @@ open class Client<CONNECTION : Connection>(
endpointIsRunning.lazySet(false)
if (stopConnectOnShutdown) {
val exception = ClientException("Client closed during connection attempt. Aborting connection attempts.")
val exception = ClientException("Client closed during connection attempt. Aborting connection attempts.").cleanStackTrace(3)
listenerManager.notifyError(exception)
throw exception
}
if (System.nanoTime() - startTime < connectionTimoutInNs) {
val type = if (connection0 == null) {
"UNKNOWN"
} else if (isIPC) {
val type = if (isIPC) {
"IPC"
} else {
"$remoteAddressPrettyString:$port1:$port2"