Skip to content

Commit 719b9d1

Browse files
evgzakharovrozza
authored andcommitted
Add to call of callback if error raise on decoding of document
JAVA-3644
1 parent 41ca7ca commit 719b9d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

driver-core/src/main/com/mongodb/internal/operation/AsyncChangeStreamBatchCursor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ public void onResult(final List<RawBsonDocument> rawDocuments, final Throwable t
173173
);
174174
return;
175175
}
176-
results.add(rawDocument.decode(changeStreamOperation.getDecoder()));
176+
try {
177+
results.add(rawDocument.decode(changeStreamOperation.getDecoder()));
178+
} catch (Exception e) {
179+
callback.onResult(null, e);
180+
return;
181+
}
177182
}
178183
resumeToken = rawDocuments.get(rawDocuments.size() - 1).getDocument("_id");
179184
callback.onResult(results, null);

0 commit comments

Comments
 (0)