From d22a638e5576c113c719e772d150a2ed97408e8d Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 28 Apr 2016 09:59:30 -0700 Subject: [PATCH] React to TryGetProject changes --- .../Internal/Implementation/ProjectProvider.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/ProjectProvider.cs b/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/ProjectProvider.cs index fc41f81888..a03bae0cf6 100644 --- a/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/ProjectProvider.cs +++ b/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/ProjectProvider.cs @@ -40,10 +40,16 @@ namespace Microsoft.DotNet.Watcher.Core.Internal { try { - var errors = new List(); - 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 {