Smarteon / loxone-java

Java implementation of the Loxone™ communication protocol (Web Socket)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

Can't parse gettoken 401 response #116

Closed jimirocks closed 3 years ago

jimirocks commented 3 years ago
ed 21 11:07:05 rpi-cz2020-07 java[17661]: 2021-01-21 11:07:05.592 ERROR 17661 --- [ctReadThread-36] cz.smarteon.loxone.LoxoneWebSocket       : Can't parse response: Unrecognized field "lastEdit" (class cz.smarteon.loxone.message.Token), not marked as ignorable (5 known properties: "tokenRights", "token", "validUntil", "key", "unsecurePass"])
led 21 11:07:05 rpi-cz2020-07 java[17661]:  at [Source: (String)"{"LL":{"control":"jdev/sys/gettoken/***/user/4/***/loxoneJava","value":{"lastEdit":"2009-01-01 01:00:00","unix":1230768000},"code":"401"}}"; line: 1, column: 211]
jimirocks commented 3 years ago

The problem is more general - in case the response doesn't have status 200 the actual transferred value can have different structure than expected for given message type. It's chicken-egg problem when for succesfull deserializing of the message the part of th message must be deserialized in advance.