Skip to content

Commit

Permalink
Tweaked logging
Browse files Browse the repository at this point in the history
  • Loading branch information
johanhaleby committed Jan 19, 2024
1 parent c28f15b commit 1fb69c1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ static Optional<ListenerLock> acquireOrRefreshFor(MongoCollection<BsonDocument>
} catch (MongoCommandException e) {
final ErrorCategory errorCategory = ErrorCategory.fromErrorCode(e.getErrorCode());

logDebug("Caught {} - {} in acquireOrRefreshFor (errorCategory={}, subscriberId={}, subscriptionId={}, duplicate={})",
e.getClass().getName(), e.getMessage(), errorCategory, subscriberId, subscriptionId, errorCategory.equals(DUPLICATE_KEY));

if (errorCategory.equals(DUPLICATE_KEY)) {
// This happens frequently, so we don't log it
return Optional.empty();
}

logDebug("Caught {} - {} in acquireOrRefreshFor (errorCategory={}, subscriberId={}, subscriptionId={})",
e.getClass().getName(), e.getMessage(), errorCategory, subscriberId, subscriptionId);

throw e;
}
});
Expand Down

0 comments on commit 1fb69c1

Please sign in to comment.