Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

500 responses send Prisma's error text to the client

Offen
#971 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
backend, security

Rechercherichtung

Start by reading ErrorHandler and the PrismaClientKnownRequestError branch, then inspect StudiesController.ts for plain Errors whose messages are intended for users. Update the handling so client responses do not expose error details while user-facing messages use UnprocessableError; log errors server-side. Done means the described 500 responses no longer expose query data or internal error text.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

backend bug

ErrorHandler ends with a catch-all that returns { message: 'Internal Server Error', details: err.message } for any error it doesn't recognise, so Prisma's own error text goes to the client. #880 sanitised the 422 ValidateError branch for #879, but not this one.

For example, PATCH /profiles/current with a key the request type allows but the profile table doesn't have, such as password, returns a 500 whose details is Prisma's dump of the query: the values sent, including the password, and every column the model accepts. logger.error writes the same text to the logs. The PrismaClientKnownRequestError branch returns err.meta as details for every code, and err.message for codes other than P2002 and P2025.

Fix: return a fixed message with no details from both branches, and log the error on the server instead. First turn the plain Errors that carry a message meant for users into UnprocessableError, such as "Study with that name already exists" in StudiesController.ts, because the admin portal shows that text from the 500's details today.

Related: #879, #880, #418, #919, #943.

Vorherrschende Sprache
TypeScript
Sterne
4
Forks
0
Ø Merge
14 Std. 50 Min.
Gemergte PRs (30 T.)
5

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Garvan-Data-Science-Platform/ctrl

Alle Issues in Garvan-Data-Science-Platform/ctrl

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.