diff --git a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/connection/factory/DataBrokerConnectorFactory.kt b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/connection/factory/DataBrokerConnectorFactory.kt index d85e4ca..657545c 100644 --- a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/connection/factory/DataBrokerConnectorFactory.kt +++ b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/connection/factory/DataBrokerConnectorFactory.kt @@ -35,10 +35,14 @@ class DataBrokerConnectorFactory { connectionInfo: ConnectionInfo, ): DataBrokerConnector { val isTlsEnabled = connectionInfo.isTlsEnabled - return if (isTlsEnabled) { - createSecureConnector(context, connectionInfo) - } else { - createInsecureConnector(connectionInfo) + try { + return if (isTlsEnabled) { + createSecureConnector(context, connectionInfo) + } else { + createInsecureConnector(connectionInfo) + } + } catch (e: IllegalArgumentException) { + throw DataBrokerException("Can't establish connection to Databroker", e) } }