AnswerDotAI / AnswerDotAI/ghapi
expose content of response when a 403 or other http error occurs
- 主要言語
- Python
- スター
- 686
- フォーク
- 69
- 平均マージ
- 1分
- マージ済み PR(30日)
- 2
説明
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.
コントリビューションガイド
調査の方向性
まず、ghapi の HTTP エラーと例外処理のエントリーポイントを追跡してください。この issue ではファイルもテストも指定されていません。403 レスポンスがどのように HTTP403ForbiddenError に変換されるかを確認し、その後、呼び出し側が元のレスポンス内容を調べられることを、GitHub のレート制限メッセージも含めて検証してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100