File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -160,19 +160,26 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
160160 }
161161 _pluginEvents . AfterRequestLog += AfterRequestLogAsync ;
162162
163- while ( ! stoppingToken . IsCancellationRequested && _proxyServer . ProxyRunning )
163+
164+ try
164165 {
165- while ( ! Console . KeyAvailable )
166+ while ( ! stoppingToken . IsCancellationRequested && _proxyServer . ProxyRunning )
166167 {
167- await Task . Delay ( 10 , stoppingToken ) ;
168- }
169- // we need this check or proxy will fail with an exception
170- // when run for example in VSCode's integrated terminal
171- if ( isInteractive )
172- {
173- await ReadKeysAsync ( ) ;
168+ while ( ! Console . KeyAvailable )
169+ {
170+ await Task . Delay ( 10 , stoppingToken ) ;
171+ }
172+ // we need this check or proxy will fail with an exception
173+ // when run for example in VSCode's integrated terminal
174+ if ( isInteractive )
175+ {
176+ await ReadKeysAsync ( ) ;
177+ }
174178 }
175179 }
180+ catch ( TaskCanceledException )
181+ {
182+ }
176183 }
177184
178185 private void FirstRunSetup ( )
You can’t perform that action at this time.
0 commit comments