mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-06 17:24:59 -05:00
Fixing issue where error objects were not serialized with camelcase property names (#360)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Hosting.Contracts;
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Serializers;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
@@ -132,6 +133,12 @@ namespace Microsoft.SqlTools.Hosting.Protocol
|
||||
contentObject));
|
||||
}
|
||||
|
||||
public async Task WriteError(string method, string requestId, Error error)
|
||||
{
|
||||
JToken contentObject = JToken.FromObject(error, contentSerializer);
|
||||
await this.WriteMessage(Message.ResponseError(requestId, method, contentObject));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,10 @@ namespace Microsoft.SqlTools.Hosting.Protocol
|
||||
Message = errorMessage,
|
||||
Code = errorCode
|
||||
};
|
||||
return this.messageWriter.WriteMessage(
|
||||
Message.ResponseError(
|
||||
return this.messageWriter.WriteError(
|
||||
requestMessage.Id,
|
||||
requestMessage.Method,
|
||||
JToken.FromObject(error)));
|
||||
error);
|
||||
}
|
||||
|
||||
public virtual Task SendError(Exception e)
|
||||
|
||||
Reference in New Issue
Block a user