fix: downgrade redundant logger.error(e) to debug in audio modules#148
Conversation
The SDK's exception handlers were logging exceptions at error level before re-raising, causing duplicate logs in user applications. Following PR #68 discussion, downgrade to debug level across audio/asr, audio/qwen_asr, and audio/tts_v2 modules. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request downgrades several exception logging statements from error to debug level across various audio-related services. The review feedback points out two critical issues: first, several of these services perform synchronous HTTP requests using the requests library under the hood, meaning they should catch requests-specific exceptions rather than asyncio or aiohttp exceptions to ensure retry logic is not bypassed; second, in the files where exceptions are re-raised, a bare raise should be used instead of raise e to preserve the original traceback, and exc_info=True should be passed to logger.debug to properly capture the traceback in the logs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Change raise e to bare raise in recognition.py and translation_recognizer.py to preserve original tracebacks - Fix vocabulary.py and enrollment.py catching asyncio/aiohttp exceptions despite using sync requests-based BaseApi; switch to requests.Timeout and requests.ConnectionError Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
BaseAsyncApi uses sync requests.Session() under the hood (the "Async" refers to DashScope server-side task polling, not Python async I/O). Switch from asyncio/aiohttp exceptions to requests.Timeout and requests.ConnectionError to ensure retry logic actually catches real network errors. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The SDK's exception handlers were logging exceptions at error level before re-raising, causing duplicate logs in user applications. Following PR #68 discussion, downgrade to debug level across audio/asr, audio/qwen_asr, and audio/tts_v2 modules.
Description
[Describe what this PR does and why]
Related Issue: Fixes #[issue_number] or Relates to #[issue_number]
Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]
Type of Change
Component(s) Affected
Checklist
Testing
[How to test these changes]
Additional Notes
[Optional: any other context]