fix: replace implicit Prisma error with explicit 404 in getBookingToD…#28919
fix: replace implicit Prisma error with explicit 404 in getBookingToD…#28919yashs33244 wants to merge 2 commits intocalcom:mainfrom
Conversation
…elete findUniqueOrThrow leaks a Prisma-internal error message when a booking is not found. Replace with findUnique + explicit HttpError(404) so the API returns a clean, user-facing "Booking not found" message rather than a redacted Prisma internals string.
|
Welcome to Cal.diy, @yashs33244! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
There was a problem hiding this comment.
Pull request overview
This PR prevents Prisma-internal “record not found” errors from leaking through the API when attempting to delete/cancel a booking, by converting the implicit Prisma exception into an explicit HTTP 404.
Changes:
- Replaces
prisma.booking.findUniqueOrThrowwithfindUniqueingetBookingToDelete. - Throws an explicit
HttpErrorwithstatusCode: 404and message"Booking not found"when no booking is returned.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
|
|
findUniqueOrThrow leaks a Prisma-internal error message when a booking is not found. Replace with findUnique + explicit HttpError(404) so the API returns a clean, user-facing "Booking not found" message rather than a redacted Prisma internals string.