Skip to content

Fix panic hook to handle audio backend errors and improve error messaging#184

Merged
LargeModGames merged 1 commit intomainfrom
Fix--Audio-backend-panic-crashes-the-TUI-(Issue-#179)
Mar 21, 2026
Merged

Fix panic hook to handle audio backend errors and improve error messaging#184
LargeModGames merged 1 commit intomainfrom
Fix--Audio-backend-panic-crashes-the-TUI-(Issue-#179)

Conversation

@LargeModGames
Copy link
Owner

This pull request makes targeted improvements to error handling and code clarity in the audio backend and streaming player logic. The most notable changes are:

Audio Backend Panic Handling:

  • The panic hook now recognizes panics originating from both audio_backend/portaudio.rs and audio_backend/rodio.rs, improving detection and messaging for recoverable audio backend errors.

Streaming Player Logic:

  • Refactored the check for the current streaming player in disconnect_streaming_player to use the ? operator for conciseness and readability.

Copilot AI review requested due to automatic review settings March 21, 2026 14:13
Copy link
Contributor

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 runtime error handling around native streaming/audio backends by (1) broadening the panic hook’s detection of recoverable audio backend panics and (2) simplifying the streaming-player disconnect guard logic for readability.

Changes:

  • Extend panic-hook detection to treat both PortAudio and Rodio backend panics as “recoverable”, emitting a user-facing message instead of running the normal panic path.
  • Refactor disconnect_streaming_player to use Option’s ? operator when retrieving the current streaming player.

@LargeModGames LargeModGames merged commit 8eee1a4 into main Mar 21, 2026
13 checks passed
@LargeModGames LargeModGames deleted the Fix--Audio-backend-panic-crashes-the-TUI-(Issue-#179) branch March 21, 2026 14:25
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.

2 participants