[PR #7143] [MERGED] fix(prisma-adapter): do not throw when deleting no records #7098

Closed
opened 2026-03-13 13:24:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7143
Author: @ping-maxwell
Created: 1/6/2026
Status: Merged
Merged: 1/6/2026
Merged by: @himself65

Base: canaryHead: fix/prisma7-silent-no-record-deletion-errs


📝 Commits (1)

  • 656c721 fix(prisma-adapter): Don't throw when deleting no records

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+1 -0)

📄 Description

closes https://github.com/better-auth/better-auth/issues/7129

The error messages differ in prisma 7 so our old if-statement logic is out of date. This PR adds an additional if-statement to ensure the Prisma 7 error can be caught


Summary by cubic

Prevent errors when deleting a non-existent record in the Prisma adapter. We now catch Prisma 7’s P2025 code so “no record” deletions return silently.

Written for commit 656c721cf6. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7143 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/6/2026 **Status:** ✅ Merged **Merged:** 1/6/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/prisma7-silent-no-record-deletion-errs` --- ### 📝 Commits (1) - [`656c721`](https://github.com/better-auth/better-auth/commit/656c721cf64ab92293922820d93825b17501f9f3) fix(prisma-adapter): Don't throw when deleting no records ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+1 -0) </details> ### 📄 Description closes https://github.com/better-auth/better-auth/issues/7129 The error messages differ in prisma 7 so our old if-statement logic is out of date. This PR adds an additional if-statement to ensure the Prisma 7 error can be caught <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevent errors when deleting a non-existent record in the Prisma adapter. We now catch Prisma 7’s P2025 code so “no record” deletions return silently. <sup>Written for commit 656c721cf64ab92293922820d93825b17501f9f3. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:24:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7098