Throwing error on `serpapi.search`

オープン
#17 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

Start by locating the Python implementation of serpapi.search and determine how HTTP errors, especially 429 responses, are currently handled. Use the reported try-catch example as the expected usage pattern, then update the README with error-handling guidance; done means search failures raise a proper error and the documented example explains rate limiting.

索引モデルが issue の本文から書いたものです。

説明

improvement

The developer team from a high-volume customer reached out that we should throw a proper error on the serpapi.search.

I've suggested using a try-catch exception to handle errors. For example:

try:
    search = serpapi.search(q="CoffeeMilk", api_key="", engine="google", location="Austin, Texas", hl="en", gl="us")
    print(search)
    print("----------------")
except Exception as e:
    if "429" in str(e):
        print("You are being rate limited")
        print(e)
    else:
        print("An error occurred")

Intercom

sidenote: we should probably update our readme to show how to handle errors.

主要言語
Python
スター
173
フォーク
24
平均マージ
1日 17時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

serpapi/serpapi-python のほかの issue

serpapi/serpapi-python の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。