Send an empty error message after global error is cleared

This commit is contained in:
Troy Dai 2016-03-09 08:15:18 -08:00
parent 12dd8d6112
commit 628f54c77c
2 changed files with 13 additions and 2 deletions

View file

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.ProjectModel.Server.Models;
namespace Microsoft.DotNet.ProjectModel.Server.Messengers
{
@ -22,6 +23,16 @@ namespace Microsoft.DotNet.ProjectModel.Server.Messengers
{
send(local.GlobalErrorMessage);
}
else
{
send(new ErrorMessage
{
Message = null,
Path = null,
Line = -1,
Column = -1
});
}
}
protected override void SetValue(ProjectSnapshot local, ProjectSnapshot remote)

View file

@ -358,8 +358,8 @@ namespace Microsoft.DotNet.ProjectModel.Server.Tests
File.WriteAllText(projectFile, content);
client.SendPayLoad(testProject, MessageTypes.FilesChanged);
messages = client.DrainAllMessages();
messages.AssertDoesNotContain(MessageTypes.Error);
var clearError = client.DrainTillFirst(MessageTypes.Error);
clearError.Payload.AsJObject().AssertProperty("Message", null as string);
}
}
}