patrickdmw commented on issue #2266:
URL: https://github.com/apache/plc4x/issues/2266#issuecomment-4578906997
The behaviour in the rewrite is a bit better, but still the error message is
not that helpful.
When configuring an invalid S7 Tag, like `%DB13:52.32:STRING` I now get
```java
org.apache.plc4x.java.api.exceptions.PlcProtocolException: Unsupported tag
type null
at
org.apache.plc4x.java.s7.S7CotpConnection.onRead(S7CotpConnection.java:406)
at
org.apache.plc4x.java.spi.drivers.ConnectionBase.read(ConnectionBase.java:313)
at
org.apache.plc4x.java.spi.drivers.messages.DefaultPlcReadRequest.execute(DefaultPlcReadRequest.java:50)
at
com.hivemq.edge.adapters.plc4x.impl.Plc4xConnection.read(Plc4xConnection.java:179)
at
com.hivemq.edge.adapters.plc4x.impl.AbstractPlc4xAdapter.poll(AbstractPlc4xAdapter.java:111)
at
com.hivemq.protocols.northbound.PerAdapterSampler.execute(PerAdapterSampler.java:61)
at
com.hivemq.edge.modules.adapters.impl.polling.PollingTask.run(PollingTask.java:84)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at
java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:328)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:309)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
```
which also does not tell me which of my tags (name) was the problem, nor
what the problem exactly is.
In my case, the error actually comes from the tag parser in
`plc4j/spi/drivers/src/main/java/org/apache/plc4x/java/spi/drivers/messages/DefaultPlcReadRequest.java#addTagAddress`
which runs it through
`plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/tag/S7PlcTagHandler.java`
and then finds that none of the pattern matches my wrong tag, so it returns
`throw new PlcInvalidTagException(tagAddress);`
this is then caught in
`plc4j/spi/drivers/src/main/java/org/apache/plc4x/java/spi/drivers/messages/DefaultPlcReadRequest.java#addTagAddress`
but silently discarded.
I think that part should lok something like
log.error("Failed to add tag address '{}' for name '{}' because
'PlcResponseCode.INVALID_ADDRESS'", tagAddress, name, e);
before returning
`return new DefaultPlcTagErrorItem<>(PlcResponseCode.INVALID_ADDRESS);`
which no longer contains the root cause information
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]