Commit 78525ff
committed
fix: send JSONRPCError instead of raw Exception for failed requests
When a JSONRPCRequest fails with a connection error in post_writer, the
error must be sent as a JSONRPCError wrapped in a SessionMessage so
the response router in BaseSession can match it to the waiting
send_request call. Sending a raw Exception causes the request to hang
indefinitely because _receive_loop forwards it to _handle_incoming
(a no-op by default) while send_request blocks on its response stream.
Notification errors are still forwarded as raw exceptions since nothing
waits on a response stream for them.1 parent 387cbfc commit 78525ff
2 files changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
480 | 490 | | |
481 | 491 | | |
482 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
2353 | 2354 | | |
2354 | 2355 | | |
2355 | 2356 | | |
2356 | | - | |
| 2357 | + | |
| 2358 | + | |
2357 | 2359 | | |
2358 | 2360 | | |
2359 | | - | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
0 commit comments