Skip to content

Commit

Permalink
log: Do not log stack trace on disco#info timeout. (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev authored Aug 16, 2023
1 parent 42cb648 commit 42dd079
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.jivesoftware.smack.ConnectionListener
import org.jivesoftware.smack.ReconnectionListener
import org.jivesoftware.smack.ReconnectionManager
import org.jivesoftware.smack.SASLAuthentication
import org.jivesoftware.smack.SmackException
import org.jivesoftware.smack.XMPPConnection
import org.jivesoftware.smack.tcp.XMPPTCPConnection
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration
Expand Down Expand Up @@ -236,6 +237,9 @@ class XmppProvider(val config: XmppConnectionConfig, parentLogger: Logger) {
val start = System.currentTimeMillis()
val featureStrings: List<String> = try {
discoveryManager.discoverInfo(jid)?.features?.map { it.`var` }?.toList() ?: emptyList()
} catch (e: SmackException.NoResponseException) {
logger.info("No response for disco#info, assuming default features.")
return Features.defaultFeatures
} catch (e: Exception) {
logger.warn("Failed to discover features for $jid: ${e.message}, assuming default feature set.", e)
return Features.defaultFeatures
Expand Down

0 comments on commit 42dd079

Please sign in to comment.