React to TryGetProject changes

This commit is contained in:
Ryan Brandenburg 2016-04-28 09:59:30 -07:00 committed by Pranav K
parent cb426cb325
commit d22a638e55
1 changed files with 9 additions and 3 deletions

View File

@ -40,10 +40,16 @@ namespace Microsoft.DotNet.Watcher.Core.Internal
{
try
{
var errors = new List<DiagnosticMessage>();
if (!ProjectReader.TryGetProject(projectFile, out project, errors))
if (!ProjectReader.TryGetProject(projectFile, out project))
{
errorMessage = string.Join(Environment.NewLine, errors.Select(e => e.ToString()));
if (project?.Diagnostics != null && project.Diagnostics.Any())
{
errorMessage = string.Join(Environment.NewLine, project.Diagnostics.Select(e => e.ToString()));
}
else
{
errorMessage = "Failed to read project.json";
}
}
else
{