rishabhdaim commented on code in PR #863:
URL: https://github.com/apache/jackrabbit-oak/pull/863#discussion_r1138138791
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -1470,8 +1499,23 @@ public <T extends Document> boolean create(Collection<T>
collection, List<Update
}
insertSuccess = true;
return true;
- } catch (MongoException e) {
- return false;
+ } catch (BsonMaximumSizeExceededException e) {
+ for (T doc : docs) {
+ if (doc.toString().length() > SIZE_LIMIT) {
+ LOG.error("The document with Id={} has size={} is
greater than the size limit",
+ doc.getId(), doc.toString().length(),
e.getMessage());
+ }
+ }
+ throw handleException(e, collection, Document.ID);
+ }
+ catch (MongoException e) {
+ for (T doc : docs) {
+ if (doc.toString().length() > SIZE_LIMIT) {
Review Comment:
Please use `doc.getMemory()`.
--
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]