Fix JSONDecodeError crash in check_connectivity for non-JSON responses - #5
Draft
obnoxiousmods with Copilot wants to merge 2 commits into
Draft
obnoxiousmods with Copilot wants to merge 2 commits into
obnoxiousmods with Copilot wants to merge 2 commits into
Conversation
…and tests - Handle non-200 status codes from /System/Info/Public before JSON parse - Catch JSONDecodeError/ValueError with actionable error messages - Add ConnectError/TimeoutException handling for /System/Info endpoint - Add HTTP 403 handling for API key permission issues - Add 13 connectivity tests covering all error scenarios Agent-Logs-Url: https://github.com/obnoxiousmods/jellyfinCleaner/sessions/aa0d815f-0525-4f03-9cbb-61e83ee0d35d Co-authored-by: obnoxiousmods <18523901+obnoxiousmods@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix JSONDecodeError in jellyfin-cleanup
Fix JSONDecodeError crash in check_connectivity for non-JSON responses
Apr 8, 2026
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.
check_connectivity()callsr.json()on the/System/Info/Publicresponse without checking the status code or handling parse failures. Any non-Jellyfin service, reverse proxy, wrong port (e.g. 8086 vs 8096), or empty response body crashes with an unhandledJSONDecodeError.Changes
/System/Info/Publicexits with actionable guidance instead of blindly calling.json()JSONDecodeError/ValueError: logs response body snippet and common causes (wrong port, reverse proxy, non-Jellyfin service)/System/Info: previously only the public endpoint had these handlers; the authenticated endpoint would raise uncaughtTests
13 new tests in
test_connectivity.pycovering: success path, empty body, HTML response, non-200 status codes, connect errors, timeouts, and all auth failure modes on both endpoints.