Skip to content

Fix silent error swallowing in session#1032

Closed
gjmulhol wants to merge 1 commit into
mainfrom
fix/silent-error-swallowing
Closed

Fix silent error swallowing in session#1032
gjmulhol wants to merge 1 commit into
mainfrom
fix/silent-error-swallowing

Conversation

@gjmulhol

Copy link
Copy Markdown

Summary

  • Replace silent pass on ValueError with logger.debug for 401 JSON parsing attempts
  • Downgrade AttributeError from logger.error to logger.debug (expected case, not an error)
  • Upgrade JSONDecodeError in _extract_response_json from logger.info to logger.warning (returning empty dict silently can cause confusing downstream failures)

Test plan

  • All 1342 existing tests pass (no new tests needed — behavioral change is logging only)

🤖 Generated with Claude Code

PR 6 of 11. Independent — no dependencies on other PRs.

- Replace silent ValueError pass with logger.debug for 401 JSON
  parsing (was completely invisible to users/developers)
- Downgrade AttributeError from logger.error to logger.debug
  (this is an expected case, not a true error)
- Upgrade JSONDecodeError in _extract_response_json from
  logger.info to logger.warning (returning empty dict silently
  can cause confusing downstream failures)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gjmulhol

Copy link
Copy Markdown
Author

Consolidated into docs/improve-sdk-documentation branch.

@gjmulhol gjmulhol closed this Mar 25, 2026
@gjmulhol gjmulhol deleted the fix/silent-error-swallowing branch March 25, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant