feat: Improve error handling#372
Open
AntonBronnfjell wants to merge 2 commits intolorenzodifuccia:masterfrom
Open
feat: Improve error handling#372AntonBronnfjell wants to merge 2 commits intolorenzodifuccia:masterfrom
AntonBronnfjell wants to merge 2 commits intolorenzodifuccia:masterfrom
Conversation
added 2 commits
March 3, 2026 11:23
- Added checks for HTTP status codes and improved error messages for book info, chapters, and TOC retrieval. - Implemented JSON parsing error handling to ensure valid responses. - Introduced ssl-skip parameter handling in the main execution block.
- Updated the session configuration to set SSL verification to False when using a proxy. - Removed unnecessary whitespace for cleaner code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves error handling and adds a new command-line option for SSL skipping in
safaribooks.py. The main changes ensure that API errors are more clearly reported with HTTP status codes and parsing errors, and introduce a mechanism to optionally skip SSL verification via a command-line flag.Error handling improvements:
get_book_info,get_book_chapters, andcreate_tocmethods, with clear error messages indicating the HTTP status and possible causes. [1] [2] [3]Command-line enhancements:
ssl-skipcommand-line argument that allows users to skip SSL verification. The flag is detected and removed fromsys.argv, and its value is stored in the parsed arguments for later use. [1] [2]