Skip to content

Handle expected Prisma API errors without Sentry noise - #1363

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/OUT-3943-cursor-automated-triage-response-0da3
Closed

Handle expected Prisma API errors without Sentry noise#1363
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/OUT-3943-cursor-automated-triage-response-0da3

Conversation

@cursor

@cursor cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Classify API-boundary errors before logging so expected 4xx responses are not emitted to Sentry via console.error.
  • Treat Prisma P2025 (missing row) and P2023 (invalid UUID/column data from malformed IDs) as handled 404 responses without logging.
  • Keep unclassified Prisma known-request errors and unexpected errors visible in logs/Sentry.
  • Added focused regression coverage for handled API/Zod/Prisma errors and unexpected logging behavior.

Testing Criteria

  • yarn test src/app/api/tests/utils/withErrorHandler.test.ts --runInBand — 8 tests passed, including no-log assertions for API/Zod/P2025/P2023 and log assertions for unclassified Prisma/unexpected errors.
  • yarn prettier:check — passed.
  • yarn lint:check — passed with existing React hook/compiler warnings only.
  • yarn tsc — still fails on the repo's pre-existing SVG module declaration errors in src/icons/index.ts; no errors from this change were reported before that baseline failure.

Notes

  • Linear and Sentry MCP servers required authentication in this automation environment, so direct event/project metadata and Linear commenting were unavailable. The trigger payload was in Triage and the Sentry-style title points at the Tasks API boundary where handled Prisma known errors were being logged.

Impact & Surface Area of Change

  • Shared API route error handling (withErrorHandler) across internal/public API routes.
  • Expected not-found/invalid-ID Prisma failures should continue returning normalized JSON responses while no longer creating Sentry noise.
  • Unexpected errors and unclassified Prisma known-request errors remain logged for investigation.
Open in Web View Automation 

cursoragent and others added 2 commits July 1, 2026 00:06
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown

OUT-3943

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview, Comment Jul 1, 2026 12:09am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants