Skip to content

Use rescue StandardError for stream close#286

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:use_rescue_standard_error_for_stream_close
Open

Use rescue StandardError for stream close#286
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:use_rescue_standard_error_for_stream_close

Conversation

@koic
Copy link
Copy Markdown
Member

@koic koic commented Apr 1, 2026

Motivation and Context

Replace bare rescue with explicit rescue StandardError in stream cleanup to clarify intent, with a comment explaining why. In Ruby, rescue without an exception class is equivalent to rescue StandardError, so this is a readability improvement with no behavior change.

How Has This Been Tested?

Existing tests will pass.

Breaking Changes

This is a readability improvement with no behavior change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@koic koic force-pushed the use_rescue_standard_error_for_stream_close branch from 9c68789 to 7954cfd Compare April 1, 2026 18:13
## Motivation and Context

Replace bare `rescue` with explicit `rescue StandardError` in stream cleanup to clarify intent,
with a comment explaining why.
In Ruby, `rescue` without an exception class is equivalent to `rescue StandardError`,
so this is a readability improvement with no behavior change.

## How Has This Been Tested?

Existing tests pass.

## Breaking Changes

None.
@koic koic force-pushed the use_rescue_standard_error_for_stream_close branch from 7954cfd to d3f400f Compare April 1, 2026 18:49
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