Skip to content

Commit a381bd3

Browse files
authored
Merge pull request OmniSharp#955 from ycholette/Don't-log-critical-message-when-client-disconnect
Don't log critical message when client disconnect
2 parents 31dcf23 + 793e66d commit a381bd3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/JsonRpc/InputHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.IO.Pipelines;
66
using System.Linq;
7+
using System.Net.Sockets;
78
using System.Reactive;
89
using System.Reactive.Concurrency;
910
using System.Reactive.Disposables;
@@ -144,9 +145,14 @@ public void Start()
144145
{
145146
await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false);
146147
}
148+
catch (IOException e)
149+
when (e.InnerException is SocketException { SocketErrorCode: SocketError.ConnectionReset })
150+
{
151+
_logger.LogInformation(e, "Connection reset by client.");
152+
}
147153
catch (Exception e)
148154
{
149-
_logger.LogCritical(e, "unhandled exception");
155+
_logger.LogCritical(e, "Unhandled exception.");
150156
}
151157
}
152158
).Subscribe(_inputActive)

0 commit comments

Comments
 (0)