Skip to content

Commit

Permalink
Merge pull request #1079 from AArnott/fix1067
Browse files Browse the repository at this point in the history
Avoid unobserved exception when read loop fails
  • Loading branch information
AArnott authored Sep 20, 2024
2 parents c2aaaf0 + a6069c7 commit 87e4571
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/StreamJsonRpc/JsonRpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2484,8 +2484,10 @@ private async Task ReadAndHandleRequestsAsync()
}
catch (Exception ex)
{
// Report the exception and kill the connection.
// Do not *re-throw* the exception from here to avoid an unobserved exception being reported
// (https://github.com/microsoft/vs-streamjsonrpc/issues/1067).
this.OnJsonRpcDisconnected(new JsonRpcDisconnectedEventArgs(ex.Message, DisconnectedReason.StreamError, ex));
throw;
}
}

Expand Down

0 comments on commit 87e4571

Please sign in to comment.