LWM2M: Catch client serialization error.
This commit is contained in:
parent
275aac5ddc
commit
f0cd43db5c
@ -94,9 +94,13 @@ public class TbRedisLwM2MClientStore implements TbLwM2MClientStore {
|
|||||||
if (client.getState().equals(LwM2MClientState.UNREGISTERED)) {
|
if (client.getState().equals(LwM2MClientState.UNREGISTERED)) {
|
||||||
log.error("[{}] Client is in invalid state: {}!", client.getEndpoint(), client.getState(), new Exception());
|
log.error("[{}] Client is in invalid state: {}!", client.getEndpoint(), client.getState(), new Exception());
|
||||||
} else {
|
} else {
|
||||||
byte[] clientSerialized = serialize(client);
|
try {
|
||||||
try (var connection = connectionFactory.getConnection()) {
|
byte[] clientSerialized = serialize(client);
|
||||||
connection.getSet(getKey(client.getEndpoint()), clientSerialized);
|
try (var connection = connectionFactory.getConnection()) {
|
||||||
|
connection.getSet(getKey(client.getEndpoint()), clientSerialized);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("Failed to serialize client: {}", client, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user