Skip to content

Commit d7a6144

Browse files
Don't log critical message when client disconnect
1 parent be43bab commit d7a6144

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/JsonRpc/InputHandler.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,17 @@ public void Start()
144144
{
145145
await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false);
146146
}
147+
catch (IOException e)
148+
{
149+
if (e.InnerException is SocketException se && se.SocketErrorCode == SocketError.ConnectionReset)
150+
_logger.LogInformation(e, "Connection reset by client.");
151+
else
152+
throw;
153+
154+
}
147155
catch (Exception e)
148156
{
149-
_logger.LogCritical(e, "unhandled exception");
157+
_logger.LogCritical(e, "Unhandled exception");
150158
}
151159
}
152160
).Subscribe(_inputActive)

0 commit comments

Comments
 (0)