AnswerDotAI / AnswerDotAI/ghapi

expose content of response when a 403 or other http error occurs

Aperta
#79 1 commento 10 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
685
Fork
70
Merge medio
1m
PR unite (30g)
2

Descrizione

I spent a long time debugging this evening when I ran a loop that made 10 search queries. I got this error from ghapi:

`HTTP403ForbiddenError: HTTP Error 403: Forbidden`

But I couldn't figure out how to get the actual HTTP response object itself so that I could see the text of the response. GitHub actually provides very informative responses, like the following:

`{"message":"API rate limit exceeded for [ip address redacted]. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
`

Documentation reveals that unauthenticated requests to search endpoints are rate-limited to 10 per minute. If ghapi can provide the full response when hitting these errors, it will help with debugging this and other issues, where GitHub rate limits, or detects some abuse, or some other issue.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando il punto di ingresso di ghapi per la gestione degli errori HTTP e delle eccezioni; l'issue non indica alcun file né alcun test. Verifica come una risposta 403 viene convertita in HTTP403ForbiddenError, quindi verifica che i chiamanti possano ispezionare il contenuto originale della risposta, incluso il messaggio di rate limit di GitHub.

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

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.