File tree Expand file tree Collapse file tree
src/Microsoft.DotNet.XHarness.Apple Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5+ using System ;
6+ using System . IO ;
57using System . Linq ;
68using System . Text . RegularExpressions ;
79using Microsoft . DotNet . XHarness . Common . Logging ;
@@ -18,7 +20,18 @@ public abstract class ExitCodeDetector : IExitCodeDetector
1820 {
1921 public int ? DetectExitCode ( AppBundleInformation appBundleInfo , IReadableLog systemLog )
2022 {
21- using var reader = systemLog . GetReader ( ) ;
23+ StreamReader reader ;
24+
25+ try
26+ {
27+ reader = systemLog . GetReader ( ) ;
28+ }
29+ catch ( FileNotFoundException e )
30+ {
31+ throw new Exception ( "Failed to detect application's exit code. The system log was empty / not found at " + e . FileName ) ;
32+ }
33+
34+ using ( reader )
2235 while ( ! reader . EndOfStream )
2336 {
2437 var line = reader . ReadLine ( ) ;
You can’t perform that action at this time.
0 commit comments