Skip to content

Fix bare except blocks catching BaseException in WebSocket handler#9

Merged
ShumaKitayama merged 3 commits intofeature-backendfrom
copilot/sub-pr-3-please-work
Nov 6, 2025
Merged

Fix bare except blocks catching BaseException in WebSocket handler#9
ShumaKitayama merged 3 commits intofeature-backendfrom
copilot/sub-pr-3-please-work

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 6, 2025

Addresses code review feedback on PR #3 regarding improper exception handling in the WebSocket endpoint.

Changes

  • Replace bare except: with except Exception: in WebSocket error handler

The bare except: block was catching BaseException, which includes system exceptions like KeyboardInterrupt and SystemExit that should propagate normally.

# Before
try:
    await websocket.close(code=status.WS_1011_INTERNAL_ERROR)
except:
    pass

# After
try:
    await websocket.close(code=status.WS_1011_INTERNAL_ERROR)
except Exception:
    pass

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…tion

Co-authored-by: ShumaKitayama <174303068+ShumaKitayama@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on feature backend implementation Fix bare except blocks catching BaseException in WebSocket handler Nov 6, 2025
Copilot AI requested a review from ShumaKitayama November 6, 2025 02:41
@ShumaKitayama ShumaKitayama marked this pull request as ready for review November 6, 2025 03:55
@ShumaKitayama ShumaKitayama merged commit c8f227c into feature-backend Nov 6, 2025
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