Commit f57a8d1
fix: propagate input stream errors through ndJsonStream (#111)
* fix: propagate input stream errors through ndJsonStream
The readable stream returned by ndJsonStream used try/finally, which
swallowed errors from the underlying input stream. When the input
errored (e.g. a child process crash), the readable stream would close
cleanly instead of erroring, causing the Connection to treat it as a
normal shutdown rather than propagating the error to pending requests.
Changed to try/catch/finally so that input stream errors are forwarded
via controller.error(), allowing Connection.#receive() to capture the
error and reject all pending requests with the original error message.
Added two tests:
- Verifies ndJsonStream propagates immediate input stream errors
- Verifies pending requests are rejected when input stream errors
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
* Fix lockfile
---------
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>1 parent e620a8d commit f57a8d1
2 files changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1016 | 1059 | | |
1017 | 1060 | | |
1018 | 1061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | | - | |
69 | 71 | | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
0 commit comments