| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR enhances the serpapi.HTTPError exception class to expose essential diagnostic information—specifically the HTTP status code and error message—making it easier for API consumers to handle different error scenarios according to SerpApi's documented Status and Error Codes.
Key Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| serpapi/exceptions.py | Implements custom __init__ for HTTPError to extract and store status_code and error from the HTTP response |
| tests/test_exceptions.py | Adds new unit test file with test coverage for the enhanced HTTPError exception properties |
| tests/test_integration.py | Updates existing integration tests to validate both status_code and error attributes in real API failure scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Related #17
The status code is essential to determine the issue with the API, which we documented in Status and Error Codes. This PR add the info to the serpapi.HTTPError exception.