Do not raise error for search archive results
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start in lib/serpapi/client.rb, especially the get handling around lines 154 and 236. Trace how archive search responses with HTTP 200 and a top-level "error" key are processed, then verify that failed searches can be retrieved without raising an error condition.
Written by the indexing model from the issue text.
Description
If the HTTP response code is 200, we should not raise an error condition. In practice, trying to investigate a set of failed searches is impossible with the client as it currently works. Consider the following:
Processing IDs from failed-searches.txt...
--------------------------------------------------------------------------------
Search ID | Created At | Processed At | Time Taken
--------------------------------------------------------------------------------
6935c0b9a0cb1015d74ef919: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c0b9a0cb1015d74ef919.json
6935c10c6372f3288d198835: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c10c6372f3288d198835.json
6935c140d1a72b12298a4c3a: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c140d1a72b12298a4c3a.json
6935c1847dcfbe884d95f202: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c1847dcfbe884d95f202.json
6935c23c0fa72e068915493a: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c23c0fa72e068915493a.json
6935c26f80c963a0739496b7: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c26f80c963a0739496b7.json
6935c2a2d99612e9a0b828b2: Error - HTTP request failed with status: 200 OK error: Google hasn't returned any results for this query. from url: https://serpapi.com/searches/6935c2a2d99612e9a0b828b2.json
The search exists, the response was successful, but because of the search api using the same get machinery:
It uses the same handling of the presence of a top level "error" key:
Instead, we should allow retrieval of failed searches from the archive without raising an error.
- Dominant language
- Ruby
- Stars
- 35
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
バグ
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voxpupuli/puppet-epel#186 · 1 comment ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OpenBug Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TheOdinProject/curriculum#31402 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100