Skip to content

Commit 87e4571

Browse files
authored
Merge pull request #1079 from AArnott/fix1067
Avoid unobserved exception when read loop fails
2 parents c2aaaf0 + a6069c7 commit 87e4571

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/StreamJsonRpc/JsonRpc.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,10 @@ private async Task ReadAndHandleRequestsAsync()
24842484
}
24852485
catch (Exception ex)
24862486
{
2487+
// Report the exception and kill the connection.
2488+
// Do not *re-throw* the exception from here to avoid an unobserved exception being reported
2489+
// (https://github.com/microsoft/vs-streamjsonrpc/issues/1067).
24872490
this.OnJsonRpcDisconnected(new JsonRpcDisconnectedEventArgs(ex.Message, DisconnectedReason.StreamError, ex));
2488-
throw;
24892491
}
24902492
}
24912493

0 commit comments

Comments
 (0)