From e70890dcbf5b3e6c211575fdd30cf732d231ba17 Mon Sep 17 00:00:00 2001 From: Yannick Cholette Date: Thu, 12 Aug 2021 15:58:02 -0400 Subject: [PATCH] Fix potential unobserved exception in InputHandler.cs --- src/JsonRpc/InputHandler.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index 6d267c101..caa294af8 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -110,9 +110,16 @@ IScheduler scheduler public void Start() { _disposable.Add( - Observable.FromAsync(() => ProcessInputStream(_stopProcessing.Token)) - .Do(_ => { }, e => _logger.LogCritical(e, "unhandled exception")) - .Subscribe(_inputActive) + Observable.FromAsync(async () => { + try + { + await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); + } + catch (Exception e) + { + _logger.LogCritical(e, "unhandled exception"); + } + }).Subscribe(_inputActive) ); _disposable.Add( _inputQueue