Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Sep 1, 2023
1 parent 96fb966 commit e00064d
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ private static TraceLevel GetTraceLevel(ServerConfiguration serverConfiguration)
return null;
}

if (!File.Exists(runSettingsPath))
{
var message = string.Format(LanguageServerResources.Runsettings_file_does_not_exist_at_0, runSettingsPath);
progress.Report(new(LanguageServerResources.Discovering_tests, message, Progress: null));
return null;
}

try
{
var contents = await File.ReadAllTextAsync(runSettingsPath, cancellationToken);
Expand All @@ -188,11 +181,17 @@ private static TraceLevel GetTraceLevel(ServerConfiguration serverConfiguration)
_logger.LogTrace($".runsettings:{Environment.NewLine}{contents}");
return contents;
}
catch (FileNotFoundException)
{
var message = string.Format(LanguageServerResources.Runsettings_file_does_not_exist_at_0, runSettingsPath);
progress.Report(new(LanguageServerResources.Discovering_tests, message, Progress: null));
}
catch (Exception ex)
{
var message = string.Format(LanguageServerResources.Failed_to_read_runsettings_file_at_0_1, runSettingsPath, ex);
progress.Report(new(LanguageServerResources.Discovering_tests, message, Progress: null));
return null;
}

return null;
}
}

0 comments on commit e00064d

Please sign in to comment.