fix: use error code 48 for collection exists exception#33
Conversation
The createCollection method threw Exception with code 0 when a collection already exists. The database adapter's processException checks for code 48 (MongoDB NamespaceExists) to convert to DuplicateException, which is then handled gracefully. Without the correct code, the exception propagates as a server error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
createCollectionmethod inClient.phpthrows anExceptionwith code0when a collection already existsprocessExceptionchecks for code48(MongoDBNamespaceExists) to convert toDuplicateException, which is then handled gracefully by returningtrue_auditare shared across projectsTest plan
createCollectionfor an existing collection returnstrueinstead of throwing🤖 Generated with Claude Code
Summary by CodeRabbit