Skip to content

Commit

Permalink
Avoid unobserved exception when read loop fails
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Sep 20, 2024
1 parent 3c6a27f commit a6069c7
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 a6069c7

Please sign in to comment.