File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
dotnet/src/webdriver/Firefox Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -345,13 +345,21 @@ private static string FirefoxDriverServiceFileName()
345345
346346 private async Task ReadStreamAsync ( StreamReader reader )
347347 {
348- string ? line ;
349- while ( ( line = await reader . ReadLineAsync ( ) ) != null )
348+ try
350349 {
351- if ( logWriter != null )
350+ string ? line ;
351+ while ( ( line = await reader . ReadLineAsync ( ) ) != null )
352352 {
353- logWriter . WriteLine ( $ "{ DateTime . Now : yyyy-MM-dd HH:mm:ss.fff} { line } ") ;
353+ if ( logWriter != null )
354+ {
355+ logWriter . WriteLine ( $ "{ DateTime . Now : yyyy-MM-dd HH:mm:ss.fff} { line } ") ;
356+ }
354357 }
355358 }
359+ catch ( Exception ex )
360+ {
361+ // Log or handle the exception appropriately
362+ System . Diagnostics . Debug . WriteLine ( $ "Error reading stream: { ex . Message } ") ;
363+ }
356364 }
357365}
You can’t perform that action at this time.
0 commit comments