Skip to content

Commit

Permalink
added debug log message to snoop duplicate key error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ujibang committed Jun 18, 2018
1 parent d155efb commit b039f01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/restheart/db/DAOUtils.java
Expand Up @@ -226,6 +226,12 @@ public static OperationResult updateDocument(
} catch (IllegalArgumentException iae) {
return new OperationResult(HttpStatus.SC_BAD_REQUEST, oldDocument, null);
} catch (MongoCommandException mce) {
LOGGER.debug("document {} not updated, "
+ "might be due to a duplicate key error. "
+ "errorCode: {}, errorMessage: {}",
documentId,
mce.getErrorCode(),
mce.getErrorMessage());
if (mce.getErrorCode() == 11000) {
if (allowUpsert
&& filter != null
Expand Down

0 comments on commit b039f01

Please sign in to comment.