Skip to content

Commit de1591e

Browse files
Fix potential unobserved exception in InputHandler.cs (#635)
Co-authored-by: Yannick Cholette <[email protected]>
1 parent 89a97d1 commit de1591e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/JsonRpc/InputHandler.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,16 @@ IScheduler scheduler
110110
public void Start()
111111
{
112112
_disposable.Add(
113-
Observable.FromAsync(() => ProcessInputStream(_stopProcessing.Token))
114-
.Do(_ => { }, e => _logger.LogCritical(e, "unhandled exception"))
115-
.Subscribe(_inputActive)
113+
Observable.FromAsync(async () => {
114+
try
115+
{
116+
await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false);
117+
}
118+
catch (Exception e)
119+
{
120+
_logger.LogCritical(e, "unhandled exception");
121+
}
122+
}).Subscribe(_inputActive)
116123
);
117124
_disposable.Add(
118125
_inputQueue

0 commit comments

Comments
 (0)