This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository
https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git
The following commit(s) were added to refs/heads/dev by this push:
new d4a524c [STREAMPIPES-367] S7 adapter fails at startup if PLC is not
reachable
d4a524c is described below
commit d4a524c8bc289ab7e452ba7ebc9a2c27703b825f
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue May 11 14:27:40 2021 +0200
[STREAMPIPES-367] S7 adapter fails at startup if PLC is not reachable
---
.../streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
index 25979d6..a8dcbbd 100644
---
a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
+++
b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
@@ -195,12 +195,12 @@ public class Plc4xS7Adapter extends PullAdapter {
try (PlcConnection plcConnection =
this.driverManager.getConnection("s7://" + this.ip)) {
if (!plcConnection.getMetadata().canRead()) {
- throw new AdapterException("The S7 on IP: " + this.ip + " does
not support reading data");
+ this.LOG.error("The S7 on IP: " + this.ip + " does not support
reading data");
}
} catch (PlcConnectionException e) {
- throw new AdapterException("Could not establish connection to S7
with ip " + this.ip, e);
+ this.LOG.error("Could not establish connection to S7 with ip " +
this.ip, e);
} catch (Exception e) {
- throw new AdapterException("Could not close connection to S7 with
ip " + this.ip, e);
+ this.LOG.error("Could not close connection to S7 with ip " +
this.ip, e);
}
}
@@ -233,7 +233,7 @@ public class Plc4xS7Adapter extends PullAdapter {
if (response.getResponseCode(node.get(PLC_NODE_NAME))
== PlcResponseCode.OK) {
event.put(node.get(PLC_NODE_RUNTIME_NAME),
response.getObject(node.get(PLC_NODE_NAME)));
} else {
- logger.error("Error[" + node.get(PLC_NODE_NAME) +
"]: " +
+ this.LOG.error("Error[" + node.get(PLC_NODE_NAME)
+ "]: " +
response.getResponseCode(node.get(PLC_NODE_NAME)).name());
}
}