In ws-proxy, don't let the debugger die just because some .pdb doesn't correspond to files we have locally

This commit is contained in:
Steve Sanderson 2018-07-10 13:49:55 +01:00
parent a728b42181
commit d9aafb05c1
1 changed files with 11 additions and 2 deletions

View File

@ -589,8 +589,17 @@ namespace WsProxy {
var res = new StringWriter ();
res.WriteLine ($"//dotnet:{id}");
using (var f = new StreamReader (File.Open (src_file.LocalPath, FileMode.Open))) {
res.Write (f.ReadToEnd ());
try
{
using (var f = new StreamReader(File.Open(src_file.LocalPath, FileMode.Open)))
{
res.Write(f.ReadToEnd());
}
}
catch (Exception ex)
{
res.WriteLine($"Unable to open file {src_file.LocalPath}");
res.WriteLine($"\nException:\n{ex}");
}
var o = JObject.FromObject (new {