Skip to content

Commit

Permalink
Merge pull request #335 from ianbattersby/fix/stdio-exception-escaping
Browse files Browse the repository at this point in the history
Fix string escaping on exception messages for Stdio
  • Loading branch information
david-driscoll committed Nov 10, 2015
2 parents 0c2dc12 + b83f2e5 commit 87f89c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/OmniSharp.Stdio/StdioServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Microsoft.AspNet.FeatureModel;
using Microsoft.AspNet.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OmniSharp.Stdio.Features;
using OmniSharp.Stdio.Protocol;
Expand Down Expand Up @@ -57,7 +58,7 @@ private void Run()
_writer.WriteLine(new EventPacket()
{
Event = "error",
Body = e.ToString()
Body = JsonConvert.ToString(e.ToString(), '"', StringEscapeHandling.Default)
});
}
});
Expand Down Expand Up @@ -107,7 +108,7 @@ private async Task HandleRequest(string json)
// updating the response object here so that the ResponseStream
// prints the latest state when being closed
response.Success = false;
response.Message = e.ToString();
response.Message = JsonConvert.ToString(e.ToString(), '"', StringEscapeHandling.Default);
}
finally
{
Expand Down

0 comments on commit 87f89c8

Please sign in to comment.