Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix(api): RPC handler collapses all errors to 500

Aperta Adatta ai principianti
#1,108 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ANSHSINGH050404 ci sta già lavorando.

Dal 9/10/2026.

  • #1109 di @ANSHSINGH050404 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Il blocco catch in handleOrpcRequest in apps/api/src/rpc/handlers.ts (intorno alle righe 84-100) restituisce INTERNAL_SERVER_ERROR per ogni errore, quindi inizia da lì e verifica come handleAppError() è già usato altrove in quel file. Fai passare le istanze note di ORPCError attraverso handleAppError() mantenendo il fallback 500 per gli errori imprevisti. È completato quando un test di regressione copre i percorsi 401 e 404 e i test RPC esistenti continuano a passare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug: ORPCError statuses are incorrectly returned as HTTP 500

Description

In apps/api/src/rpc/handlers.ts:84–100, handleOrpcRequest catches all errors thrown by createContext() or handle() and returns INTERNAL_SERVER_ERROR (HTTP 500), regardless of the original error.

Although the error is logged via recordORPCError(), it is never passed to handleAppError(). As a result, known ORPCError instances lose their original HTTP status and error code.

Impact
  • Authentication failures (401) and permission errors (403) are reported as server errors.
  • Not-found (404), rate-limit (429), and payment-required (402) responses are incorrectly converted to 500.
  • Clients may retry non-retryable requests unnecessarily.
  • Error monitoring and alerting become less reliable because client errors are misclassified as server failures.
Expected Behavior

Known ORPCError instances should be passed through handleAppError() so their original error codes and HTTP statuses are preserved. Only genuinely unexpected errors should fall back to HTTP 500.

Acceptance Criteria
  • Preserve original status codes and error codes for known ORPCError instances.
  • Add regression tests covering at least the 401 and 404 paths.
  • Ensure unexpected errors still return HTTP 500.
  • Keep existing RPC tests passing.
Lingua principale
TypeScript
Stelle
1.2k
Fork
225
Merge medio
12h 42m
PR unite (30g)
288

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di databuddy-analytics/Databuddy

Tutte le issue di databuddy-analytics/Databuddy

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.