Code review comment: Wouldn't this indicate a critical failure - tracing as warning and ignoring unexpected backend response seems to make it harder than necessary to identify breaking changes / debug it?

Code before review:
public Mono<List<ChangeFeedProcessorState>> getCurrentState() {
List<ChangeFeedProcessorState> earlyResult = new ArrayList<>();
if (this.leaseStoreManager == null || this.feedContextClient == null) {
return Mono.just(earlyResult);
}
return this.leaseStoreManager.getAllLeases()
.flatMap(lease -> {
ChangeFeedOptions options = new ChangeFeedOptions()
.setMaxItemCount(1)
.setPartitionKeyRangeId(lease.getLeaseToken())
.setStartFromBeginning(true)
.setRequestContinuation(lease.getContinuationToken());
return this.feedContextClient.createDocumentChangeFeedQuery(this.feedContextClient.getContainerClient(), options)
.take(1)
.map(feedResponse -> {
final String pkRangeIdSeparator = ":";
final String segmentSeparator = "
final String lsnPropertyName = "_lsn";
final String tsPropertyName = "_ts";
String sessionTokenLsn = feedResponse.getSessionToken();
String parsedSessionToken = sessionTokenLsn.substring(sessionTokenLsn.indexOf(pkRangeIdSeparator));
String[] segments = parsedSessionToken.split(segmentSeparator);
String latestLsn = segments[0];
if (segments.length >= 2) {
latestLsn = segments[1];
}
ChangeFeedProcessorState changeFeedProcessorState = new ChangeFeedProcessorState()
.setId(lease.getId())
.setHostName(lease.getOwner())
.setLeaseToken(lease.getLeaseToken())
.setLastUpdate(ZonedDateTime.parse(lease.getTimestamp()).toInstant());
if (feedResponse.getResults() == null || feedResponse.getResults().size() == 0) {
changeFeedProcessorState.setEstimatedLag(0);
changeFeedProcessorState.setContinuationToken(latestLsn);
return changeFeedProcessorState;
}
changeFeedProcessorState.setContinuationToken(feedResponse.getResults().get(0).get(lsnPropertyName).asText(null));
try {
changeFeedProcessorState.setContinuationTokenTimestamp(Instant.ofEpochMilli(Long.valueOf(
feedResponse.getResults().get(0).get(tsPropertyName).asText("0"))));
} catch (NumberFormatException ex) {
logger.warn("Unexpected Cosmos _ts found", ex);
changeFeedProcessorState.setContinuationTokenTimestamp(null);
}
Integer currentLsn = 0;
Integer estimatedLag = 0;
try {
currentLsn = Integer.valueOf(feedResponse.getResults().get(0).get(lsnPropertyName).asText("0"));
estimatedLag = Integer.valueOf(latestLsn);
estimatedLag = estimatedLag - currentLsn + 1;
changeFeedProcessorState.setEstimatedLag(estimatedLag);
} catch (NumberFormatException ex) {
logger.warn("Unexpected Cosmos LSN found", ex);
changeFeedProcessorState.setEstimatedLag(-1);
}
return changeFeedProcessorState;
});
})
.collectList()
.map(Collections::unmodifiableList);
}

Line under review: } catch (NumberFormatException ex) {

Code after addressing the review:
new ChangeFeedOptions()
.setMaxItemCount(1)
.setPartitionKeyRangeId(lease.getLeaseToken())
.setStartFromBeginning(true)
.setRequestContinuation(lease.getContinuationToken());
return this.feedContextClient.createDocumentChangeFeedQuery(this.feedContextClient.getContainerClient(), options)
.take(1)
.map(feedResponse -> {
String ownerValue = lease.getOwner();
String sessionTokenLsn = feedResponse.getSessionToken();
String parsedSessionToken = sessionTokenLsn.substring(sessionTokenLsn.indexOf(PK_RANGE_ID_SEPARATOR));
String[] segments = StringUtils.split(parsedSessionToken, SEGMENT_SEPARATOR);
String latestLsn = segments[0];
if (segments.length >= 2) {
latestLsn = segments[1];
}
if (ownerValue == null) {
ownerValue = "";
}
if (feedResponse.getResults() == null || feedResponse.getResults().size() == 0) {
return Pair.of(ownerValue + "_" + lease.getLeaseToken(), 0);
}
Integer currentLsn = 0;
Integer estimatedLag = 0;
try {
currentLsn = Integer.valueOf(feedResponse.getResults().get(0).get(PROPERTY_NAME_LSN).asText("0"));
estimatedLag = Integer.valueOf(latestLsn);
estimatedLag = estimatedLag - currentLsn + 1;
} catch (NumberFormatException ex) {
logger.warn("Unexpected Cosmos LSN found", ex);
estimatedLag = -1;
}
return Pair.of(ownerValue + "_" + lease.getLeaseToken() + "_" + currentLsn + "_" + latestLsn, estimatedLag);
}