AnswerDotAI / AnswerDotAI/ghapi
expose content of response when a 403 or other http error occurs
- Vorherrschende Sprache
- Python
- Sterne
- 685
- Forks
- 70
- Ø Merge
- 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den Einstiegspunkt von ghapi für die Behandlung von HTTP-Fehlern und Ausnahmen nachzuverfolgen; das Issue nennt keine Datei und keinen Test. Bestätige, wie eine 403-Antwort in HTTP403ForbiddenError umgewandelt wird, und überprüfe anschließend, dass Aufrufer den ursprünglichen Antwortinhalt inspizieren können, einschließlich der Rate-Limit-Nachricht von GitHub.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100