Commit 85252e0
committed
Suppress
This PR suppresses the following backtrace of `Interrupt` (Ctrl+c) exception for stdio server:
## Before
```console
$ ./examples/stdio_server.rb
^C/Users/koic/src/github.com/modelcontextprotocol/ruby-sdk/lib/mcp/server/transports/stdio_transport.rb:20:
in 'IO#gets': Interrupt
from /Users/koic/src/github.com/modelcontextprotocol/ruby-sdk/lib/mcp/server/transports/stdio_transport.rb:20:
in 'MCP::Server::Transports::StdioTransport#open'
from ./examples/stdio_server.rb:95:in '<main>'
$ echo $?
130
```
## After
```console
$ ./examples/stdio_server.rb
^C
Exiting...
$ echo $?
130
```
This change should prevent unexpected backtrace from appearing when running the example:
https://github.com/modelcontextprotocol/ruby-sdk?tab=readme-ov-file#stdio-transportInterrupt exception for stdio server1 parent fda5640 commit 85252e0
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
0 commit comments