Skip to content

Catch Empty exception in streamer.py#293

Open
Chintanpatel24 wants to merge 1 commit intomicrosoft:mainfrom
Chintanpatel24:patch-1
Open

Catch Empty exception in streamer.py#293
Chintanpatel24 wants to merge 1 commit intomicrosoft:mainfrom
Chintanpatel24:patch-1

Conversation

@Chintanpatel24
Copy link
Copy Markdown

Handle empty queue exception specifically instead of a general exception.

Handle empty queue exception specifically instead of a general exception.
Copilot AI review requested due to automatic review settings March 31, 2026 13:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens exception handling in the streaming iterator to only swallow the expected “queue empty” condition, improving debuggability and preventing unrelated errors from being silently ignored.

Changes:

  • Import Empty from queue alongside Queue.
  • Replace a bare except: in AudioBatchIterator.__next__ with except Empty: so only the empty-queue case is handled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants