diff --git a/src/Microsoft.SqlTools.Hosting/Hosting/Contracts/Error.cs b/src/Microsoft.SqlTools.Hosting/Hosting/Contracts/Error.cs
index cd1ec1a6..56f133a6 100644
--- a/src/Microsoft.SqlTools.Hosting/Hosting/Contracts/Error.cs
+++ b/src/Microsoft.SqlTools.Hosting/Hosting/Contracts/Error.cs
@@ -16,11 +16,6 @@ namespace Microsoft.SqlTools.Hosting.Contracts
///
public int Code { get; set; }
- ///
- /// Optional information to return with the error
- ///
- public object Data { get; set; }
-
///
/// Error message
///
diff --git a/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/RequestContext.cs b/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/RequestContext.cs
index c0889a06..55847271 100644
--- a/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/RequestContext.cs
+++ b/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/RequestContext.cs
@@ -39,14 +39,13 @@ namespace Microsoft.SqlTools.Hosting.Protocol
eventParams);
}
- public virtual Task SendError(string errorMessage, int errorCode = 0, object data = null)
+ public virtual Task SendError(string errorMessage, int errorCode = 0)
{
// Build the error message
Error error = new Error
{
Message = errorMessage,
- Code = errorCode,
- Data = data
+ Code = errorCode
};
return this.messageWriter.WriteMessage(
Message.ResponseError(
@@ -58,7 +57,7 @@ namespace Microsoft.SqlTools.Hosting.Protocol
public virtual Task SendError(Exception e)
{
// Overload to use the parameterized error handler
- return SendError(e.Message, e.HResult, e.ToString());
+ return SendError(e.Message, e.HResult);
}
}
}
diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/CredentialServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/CredentialServiceTests.cs
index df6fc9b7..d91f64b2 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/CredentialServiceTests.cs
+++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/CredentialServiceTests.cs
@@ -76,7 +76,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task SaveCredentialThrowsIfCredentialIdMissing()
{
string errorResponse = null;
- var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
+ var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code) => errorResponse = msg);
await service.HandleSaveCredentialRequest(new Credential(null), contextMock.Object);
TestUtils.VerifyErrorSent(contextMock);
@@ -87,7 +87,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task SaveCredentialThrowsIfPasswordMissing()
{
string errorResponse = null;
- var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
+ var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code) => errorResponse = msg);
await service.HandleSaveCredentialRequest(new Credential(CredentialId), contextMock.Object);
TestUtils.VerifyErrorSent(contextMock);
@@ -186,7 +186,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task ReadCredentialThrowsIfCredentialIsNull()
{
string errorResponse = null;
- var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
+ var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws on null, and this is sent as an error
await service.HandleReadCredentialRequest(null, contextMock.Object);
@@ -198,7 +198,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task ReadCredentialThrowsIfIdMissing()
{
string errorResponse = null;
- var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
+ var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws with no ID
await service.HandleReadCredentialRequest(new Credential(), contextMock.Object);
@@ -228,7 +228,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task DeleteCredentialThrowsIfIdMissing()
{
object errorResponse = null;
- var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
+ var contextMock = RequestContextMocks.Create(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws with no ID
await service.HandleDeleteCredentialRequest(new Credential(), contextMock.Object);
diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/TSqlFormatterServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/TSqlFormatterServiceTests.cs
index 5ecd1088..135d618f 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/TSqlFormatterServiceTests.cs
+++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/TSqlFormatterServiceTests.cs
@@ -154,7 +154,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
public static void VerifyResult(Mock> contextMock, Action verify)
{
contextMock.Verify(c => c.SendResult(It.IsAny()), Times.Once);
- contextMock.Verify(c => c.SendError(It.IsAny(), It.IsAny(), It.IsAny