You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/01/17 10:28:20 UTC

[incubator-plc4x] branch develop updated: - Made the TcpSocketChannelFactory wrap any exception into a Plc4xException in order to fix issues with some tests which would fail for people with DNS providers with capture-all responses.

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3bf21b0  - Made the TcpSocketChannelFactory wrap any exception into a Plc4xException in order to fix issues with some tests which would fail for people with DNS providers with capture-all responses.
3bf21b0 is described below

commit 3bf21b0f646cdca151b3bad7be9073e4bfd6ddaf
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Jan 17 11:28:09 2019 +0100

    - Made the TcpSocketChannelFactory wrap any exception into a Plc4xException in order to fix issues with some tests which would fail for people with DNS providers with capture-all responses.
---
 .../src/test/java/org/apache/plc4x/java/modbus/ModbusPlcDriverTest.java | 2 +-
 .../org/apache/plc4x/java/base/connection/TcpSocketChannelFactory.java  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ModbusPlcDriverTest.java b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ModbusPlcDriverTest.java
index a8cbfd1..39364a5 100644
--- a/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ModbusPlcDriverTest.java
+++ b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ModbusPlcDriverTest.java
@@ -101,7 +101,7 @@ public class ModbusPlcDriverTest {
 
     @Test(expected = PlcConnectionException.class)
     public void getConnectionUnknownPort() throws Exception {
-        new PlcDriverManager().getConnection("modbus:tcp://nowhere:unknown");
+        new PlcDriverManager().getConnection("modbus:tcp://localhost:unknown");
     }
 
     /**
diff --git a/plc4j/protocols/driver-bases/tcp/src/main/java/org/apache/plc4x/java/base/connection/TcpSocketChannelFactory.java b/plc4j/protocols/driver-bases/tcp/src/main/java/org/apache/plc4x/java/base/connection/TcpSocketChannelFactory.java
index 31b869d..0631e1a 100644
--- a/plc4j/protocols/driver-bases/tcp/src/main/java/org/apache/plc4x/java/base/connection/TcpSocketChannelFactory.java
+++ b/plc4j/protocols/driver-bases/tcp/src/main/java/org/apache/plc4x/java/base/connection/TcpSocketChannelFactory.java
@@ -57,6 +57,8 @@ public class TcpSocketChannelFactory implements ChannelFactory {
         } catch (InterruptedException e) {
             Thread.currentThread().interrupt();
             throw new PlcConnectionException("Error creating channel.", e);
+        } catch (Exception e) {
+            throw new PlcConnectionException("Error creating channel.", e);
         }
     }