Remove `RealImapConnection.handleConnectException()`
@@ -23,7 +23,6 @@ import java.io.BufferedOutputStream
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
-import java.net.ConnectException
import java.net.InetAddress
import java.net.InetSocketAddress
import java.net.Socket
@@ -101,8 +100,6 @@ internal class RealImapConnection(
retrievePathDelimiterIfNecessary()
} catch (e: SSLException) {
handleSslException(e)
- } catch (e: ConnectException) {
- handleConnectException(e)
} catch (e: GeneralSecurityException) {
throw MessagingException("Unable to open connection to IMAP server due to security error.", e)
} finally {
@@ -121,20 +118,6 @@ internal class RealImapConnection(
}
}
- // TODO: Remove this. There is no documentation on why this was added, there are no tests, and this is unlikely to
- // still work.
- private fun handleConnectException(e: ConnectException) {
- val message = e.message ?: throw e
-
- val tokens = message.split("-")
- if (tokens.size > 1) {
- Timber.e(e, "Stripping host/port from ConnectionException for %s", logId)
- throw ConnectException(tokens[1].trim())
- } else {
- throw e
- }
- }
-
@get:Synchronized
override val isConnected: Boolean
get() {
